Jump to Navigation

Virtual Debian

I have been trying to get old versions of Debian to run as virtual machines. Most of it works without trouble, but there are some things you should be aware of, if you want to try it yourself.

My host is a Debian Wheezy machine running Linux kernel 3.11 and Qemu/KVM 1.1.2, using Virtual Machine Manager (virt-manager) 0.9.1.

Installation media for Debian 3.0 (woody) and later can be found at the Debian CDs/DVDs archive. For Debian 3.1 (sarge) and later there are netinstall images that are very useful. I used the last release of each version.

There is amd64 support as of Debian 4 (etch). You can either emulate an 32-bit processor or just keep using the standard 64 bit processor. The latter is probably faster.

As of Debian 5 (lenny) you can use the virtio driver for your emulated hard disk and network card. This is highly recommended, as it is a lot faster. For older Debian versions you need to emulate real hardware. Even etch-and-a-half does not have the virtio drivers yet.

For lenny, I had some trouble getting the virtio drivers loaded by the initramfs. The solution was to boot using the rescue mode of the installation CD, add the modules virtio_blk, virtio_balloon, virtio_net, virtio_pci, virtio_ring and virtio itself to /etc/initramfs-tools/modules and run update-initramfs -k all -u.

You need to give in the archive locations (repositories) by hand for anything older than Debian 6.0 (squeeze); else it will either complain that the repository is not found or possibly use the repository of another release with somewhat undefined results. The Debian Distribution Archive has a list of mirrors. In most installers, you can enter this by scrolling to the top of the list of mirrors.

I wanted the virtual machines to be on the same network as the host. I tried using the macvtap devices, but with them it is impossible to have network traffic between a virtual machine and the host it is on, even in so-called bridged mode. Eventually, I had the best result with creating a bridge myself on the host and adding its network interface to it. Then, you can simply select the bridge as network device and virt-manager will automatically add a new vnet interface to it when the virtual machine starts.



Blog_article | by Dr. Radut