Borys Bradel's Blog

More on virtual machines and linux

Tags: linux December 23, 2009    

The following are a recap of how to set up a virtual machine, more observations about using kvm, and a comparison between Fedora and Ubuntu. Both are using a 5GB virtual hard drive. The hard drive usage is from the current state of the respective virtual hard drives.

Setting up a virtual machine

First create an image with the following command (the example is for a 10GB fedora machine):

qemu-img create -f qcow2 fedora.img 10G

Then download an iso of the operating system, e.g. Fedora-12-i386-netinst.iso, and run kvm with the following command line:

kvm -M pc -hda fedora.img -m 512 -cdrom Fedora-12-i386-netinst.iso -net nic,model=e1000 -net user -boot d

Follow the installation instructions. Eventually, everything will reboot and you will be put back at the original screen. That is when you can close the kvm window and then run kvm again with the following command:

kvm -M pc -hda fedora.img -m 512 -net nic,model=e1000 -net user -boot c

Make sure to run the update manager and get all the updates. After that you can use the system and install whatever packages you want. Putting the above command in a script file is probably a good idea.

More observations about using kvm to run linux

Sound can be enabled by adding the -soundhw all option to the command line. Unfortunately just enabling sound consumes a large amount of CPU power, and leaving sound disabled is probably better. Given that flash in general and sound in flash in particular still has a long distance to go, not having sound is not much of a loss.

When the update manager was updating Fedora the following error was reported by kvm a large number of times with different addresses and values

virtio_ioport_write: unexpected address 0x0 value 0x0

Definitely not nice. Also, Fedora did not shut down properly after that. Although that's not a surprise.

Also, sometimes keys, such as ctrl or down or page down, seem to be stuck. Also, sometimes the escape character seems to be lost. The way to get the key get unstuck is to press a different key. Usually the right ctrl gets stuck. To fix it, pressing the left ctrl key usually works, although sometimes the right ctrl key may be better. For down and page down the up key seems to work.

Also gnutris doesn't work properly in the kvm. I looked at the source and could not find anything unusual. The problem probably lies in the underlying library being used.

Finally, adobe flash player does not work very well, although I mentioned that already.

Fedora

The base system, which includes Firefox, with Thunderbird is 3.1GB. Although that probably includes some extras, because I installed various packages.

/usr is 2.4GB (/usr/share is 1.4GB, /usr/lib is 785MB, and /usr/bin is 147MB)

/var is 374MB (/var/cache is 280MB and /var/lib is 90MB)

/lib is 205MB

/home is 120MB

/boot is 47MB

/etc is 22MB

/sbin is 13MB

/bin is 7MB

Everything else is a lot smaller. Thunderbird is 65MB of /home and 85MB of /usr/lib

The main drive is about 3.9 million 1K blocks, the temp drive is 0.25 million 1K blocks, and the boot drive is 0.20 million 1K blocks. The temp drive is large enough for Fedora to hibernate. Also, Firefox is put in the repository faster than in ubuntu. On the downside, the number of updates that are needed for Fedora is a little too much for me.

Ubuntu

The main drive is 4.9 million 1K blocks, the temp drive is 0.25 million 1K blocks. I'm not sure where the discrepancy in block count comes from. Also, the temp drive seems to be divided among a bunch of different directories, and is not large enough to hibernate the system. A big disadvantage of using Ubuntu. It'd be nice to know how big a hard drive is needed before Ubuntu assigns enough swap space for it to be able to hibernate. The other disadvantage is that the update manager does not indicate the severity of updates and which updates require a reboot.

The base system, which includes Firefox, without Thunderbird is 2.7GB.

/usr is 1.8GB (/usr/lib is 771MB, /usr/share is 716MB, and /usr/bin is 121MB)

/var is 458MB (/var/cache is 291MB and /var/lib is 161MB)

/lib is 279MB

/home is 73MB

/boot is 43MB

/etc is 13MB

/sbin is 8MB

/bin is 5MB

Everything else is a lot smaller.

The biggest difference in terms of files between Ubuntu and Fedora is that the locale information in Fedora is huge. Many of the LC_MESSAGES folders in each locale under /usr/share/locale/ is up to 11MB, for a total of over 432MB while in Ubuntu each folder is under 1MB and the total is under 18MB.

Copyright © 2009 Borys Bradel. All rights reserved. This post is only my possibly incorrect opinion.

Previous Next