Virtualization

From Elvanör's Technical Wiki
Revision as of 23:11, 7 April 2011 by Elvanor (talk | contribs)
Jump to navigation Jump to search

Virtualization is the ability to run several different OS on one host.

VirtualBox

  • VirtualBox is an excellent free virtualization program. Very nice and polished GUI, it can run Windows without any problems and is really impressive.
  • To get a resolution of 1280*1024, be sure to install the VirtualBox additions (emerge this, then install them inside the virtual machine, which means inside Windows via the ISO image).

Network

  • Inside a VBox host, there is another internal NAT. You can give the guest an IP of 10.0.2.x; the gateway should be 10.0.2.2 (this is actually the address of your host). Note that you should *not* give an IP of 192.168.0.x to a VM guest!
  • If you want several guest VMs to see each other in the network, do not use NAT. Use Bridged Networking. It works really well and allow your guests to be seen as other computers on your normal LANs. Thus the gateway should be your usual router.
  • When using Bridget Networking, you must choose the actual interface of the host machine (eth0 or wlan0 for instance). Note that in the guest, the network interface will still be eth0 no matter what you chose for the VirtualBox adapter.
  • If you create a new VirtualBox machine, with a cloned Gentoo disk image, udev will probably get confused by the change of the MAC address for the network card (VBox generates a new one when creating a new machine). It will have the effect of renaming eth0 to eth1. To fix the problem you can just delete the file:
/etc/udev/rules.d/70-persistent-net.rules

Managing Media (Hard Drives)

  • To duplicate a HD, you must use the VBoxManage program with the clonehd argument (and give the absolute path to the disk to be cloned). This allows the new disk to have a different uuid and thus be used without problems.
  • To extend the size of a HD, use:
modifyhd /home/elvanor/path/hd.vdi --resize 50000
  • You must after that resize the partitions (first by modifying the partition table via fdisk, and then by using resize2fs - despite the name, it works with ext4).

DirectX

  • DirectX does not work on VirtualBox, which means that the DX PNG transparency fix does not work on IE 6 on a VirtualBox VM.

Bugs

  • VirtualBox uses a kernel module (for speed reasons). This unfortunately can mean that VBox has the ability to panic the kernel (the whole system can crash)!
  • Currently if you start multiple Linux guests, I am experiencing lockups. This seems to happen when there is no activity on the computer.