Virtualization |
| Submitted by ntd on Fri, 2009-05-22 12:36 |
VMWare on Ubuntu
Summary: Don't do it. Use virtualbox.
- Download the gratis vmware server. Pick the tarball version. Trying to install the RPM with alien will not work very well.
VirtualBox on Ubuntu
VirtualBox is free, Free, and mostly painless. Also, it doesn't do that stupid web-based crap that VMWare Server switched to in version 2, nor does it thrash disk while doing nothing like VMWare does. Unfortunately, VirtualBox does seem to use stupendous CPU while doing IO.
Booting Raw Disk Partition
- Installation on Ubuntu: `
apt-get install virtualbox' - Figure out which partition you want to boot from: `
fdisk -l /dev/sda'. (If you have more than one hard disk, it might not be sda.) - Let's assume you're booting the virtualized OS from partition 1.
- create a fake mbr: `
apt-get install mbr && install-mbr --partition 1 --timeout 0 --force myBootRecord.mbr' - Create a disk descriptor for partition 1: `
sudo VBoxManage internalcommands createrawvmdk -filename ./DiskDescriptor.vmdk -rawdisk /dev/sda -partitions 1 -mbr ./myBootRecord.mbr -relative' - Start virtualbox: `
virtualbox'. Note that you will probably need to run as root (unless your user can read the device file for the disk). - Add the virtual disk: File->Virtual Disk Manager
- Create a New VM: Machine->New
- Start the VM
MSWindows and IO-APIC
Modern hardware (and VMWare) provide an IO-APIC. VirtualBox can also do this, but it is very slow and not enabled by default. If MSWindows has been installed on a system with an IO-APIC, it will probably fail to boot if you try to run it on VirtualBox without one. This can be fixed by booting VirtualBox from the MSWin install CD and doing a recovery install. There may also be some hardware profile magic you can do to let you run both in VirtualBox and on the metal.
Bridging Networks
If you want to put your VM on a network and NAT (which should "Just Work (tm)") won't quite cut it, the easiest way to do this is probably to create a network bridge (at least it's probably easier than routing). This will make your VM act as if it is plugged into a physical network (really, the physical machine acts like a network switch between the VM and the physical network). Note also that with a bridge, you do not need to configure the ip addresses for the various interfaces that the bridge connects; they are all addressed by the IP address of the bridge interface. Instructions for Ubuntu/Debian are:
- Install tap and bridge utilities: `
apt-get install uml-utilities bridge-utils' - Setup tap network device: `
tunctl' - Create Bridge. For this example, let's bridge the virtual interface tap0 with the physical interface eth1 on a private subnet. Add the following stanza to /etc/network/interfaces:
iface br_vb_eth1 inet static
bridge_ports tap0 eth1
address 192.168.1.10
netmask 255.255.255.0
- Bring up the bridge: `
ifup br_vb_eth1' - Start virtual box and switch the VM's network to "Host Based" and connect it to tap0.
- Configure networking in the VM's OS to static or DHCP depending on your particular configuration.
External Links
- VirtualBox Downloads: Including the user's manual
- VirtualBox Linux Downloads: Ubuntu repositories for the closed-source version, gratis for academic use.
- Ubuntu Network Bridging







