Creating an Ubuntu file system for UML is simple. Just use debootstrap.
First, build a disk image. The commands below creates a 1GB sparse disk image with an ext3 file system
Code:
dd if=/dev/zero of=ubuntu-fs bs=1024 seek=1M count=1
mkfs.ext3 ubuntu-fs
Next, install debootstrap, mount your disk image, and install your system. You can replace gutsy with your preferred ubuntu release.
Code:
sudo apt-get install debootstrap
sudo mount -o loop ubuntu-fs /mnt
sudo debootstrap --arch i386 gutsy /mnt http://us.archive.ubuntu.com/ubuntu
Finally, chroot into the filesystem and install ubuntu-desktop and any other packages you require. debootstrap installs a minimal command-line system, so you need to install and configure your new system.
Code:
host$ sudo chroot /mnt /bin/bash --login -i
uml guest# apt-get install ubuntu-desktop ...
Once you have your file system configured, you need to unmount it before using it with uml.
Code:
sudo umount /mnt
./linux ubda=ubuntu-fs mem=128M
There are plenty of tutorials out there. Just google for "ubuntu debootstrap" or just "debootstrap". Enjoy.
Bookmarks