Ritesh Raj Sarraf | 14 Feb 2012 13:25
Favicon
Gravatar

[uml-user] UML root image sharing


Hello List,

Is there a particular format of the root image that UML uses?

My intent is to have one single image and use it across all different
virtualizations, i.e. use the same image with UML, VirtualBox, KVM etc.

I tried to boot with the VirtualBox vdi image but UML paniced stating
that it couldn't mount a file system off of that image. It was a
single partitioned root file system with no /boot or swap.

Does UML understand the partitions in an image?

Meanwhile I'll try with a partition-less image.

Ritesh

--

-- 
Given the large number of mailing lists I follow, I request you to CC me
in replies for quicker response
Antoine Martin | 14 Feb 2012 16:57
Picon
Favicon

Re: [uml-user] UML root image sharing

On 02/14/2012 07:25 PM, Ritesh Raj Sarraf wrote:
> Hello List,
> 
> Is there a particular format of the root image that UML uses?
See block devices here:
http://user-mode-linux.sourceforge.net/configure.html

As for partition tables and filesystem types, UML is a Linux kernel so
it will support whatever you compile in.

> My intent is to have one single image and use it across all
> different virtualizations, i.e. use the same image with UML,
> VirtualBox, KVM etc.
KVM can work with raw disks too, not sure about the others but you can
use their disk tools to convert to and from raw disks. More info here:
http://fs.devloop.org.uk/

> I tried to boot with the VirtualBox vdi image but UML paniced
> stating that it couldn't mount a file system off of that image. It
> was a single partitioned root file system with no /boot or swap.
Won't work. UML doesn't know what a VDI image is (or vmdk or whatever)

> Does UML understand the partitions in an image?
This has nothing to do with the partitions, it's the disk format.

> Meanwhile I'll try with a partition-less image.
Won't help.

Cheers
Antoine
(Continue reading)

Riccardo Murri | 14 Feb 2012 17:27
Picon
Gravatar

Re: [uml-user] UML root image sharing

Hello,

On Tue, Feb 14, 2012 at 13:25, Ritesh Raj Sarraf <rrs <at> researchut.com> wrote:
> Is there a particular format of the root image that UML uses?
>

It's the "raw" image format.

Using the KVM tools, you can create one with "qemu-img create -f raw".

Otherwise just use "dd" as in:

  # create a 2GB raw disk image
  dd if=/dev/zero of=my_uml_disk.img bs=1m count=2048

> My intent is to have one single image and use it across all different
> virtualizations, i.e. use the same image with UML, VirtualBox, KVM etc.
>

Probably the simplest approach is to use KVM or VirtualBox to
install to partition the disk and install the OS on it.  Then you just
pick a UML kernel compatible with the OS on the disk image and start
it.  (I'm not sure VirtualBox can handle "raw" images, though.)

Use LABEL= or UUID= lines in /etc/fstab, or you'll run into troubles
as different virtualization systems use different device names for the
emulated disk (e.g., "/dev/ubda" vs. "/dev/xvda" vs. "/dev/sda" etc.)

Best regards,
Riccardo
(Continue reading)


Gmane