How to install a 64bit Linux virtual machine on a 32bit Linux

32bit64bitvirtual machine

I've got a computer (Intel core i5) with 32bit Linux installed (ubuntu 11.04) and I would like to install a 64bit Linux virtual machine on it so I can test 64bit command-line applications on it.

Best Answer

Both VMware and VirtualBox can run a 64-bit virtual machine on a 32-bit host system, if you have a 64-bit processor. For VirtualBox, your processor must have hardware virtualization support (either AMD-V or VT-x, shown as svm and vmx in the flags: line of /proc/cpuinfo under Linux); most x86-64 processors except for the earlier ones, and in particular I think all core i5 models, have this support.

Failing that, you can use a virtual machine technology that emulates an x86-64 processor in software, such as Qemu. But it's not a good idea if you don't need it: it's slow, memory-hungry, and awkward.

My recommendation is to just get a 64-bit host or at least a 64-bit kernel. You can run 32-bit applications on an x86-64 (a.k.a. amd64) kernel, in fact you can run a wholly 32-bit Linux userland on an amd64 Linux kernel.

Ubuntu doesn't provide a 64-bit kernel in its i386 distribution (Debian does). You can grab the kernel from the amd64 distribution, and applications should just run, but under natty the package isn't easily installable.

So the easiest route to running 64-bit applications would be make a parallel installation of an amd64 Ubuntu. Install it on a separate partition, keeping your existing 32-bit installation as well. In the 64-bit system, mount the existing partitions, then set up a 32-bit schroot (see this guide)) to run 32-bit programs.

Related Question