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.
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
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.
Gilles points out that I was mistaken about VirtualBox and VMware supporting 64-bit guests on 32-bit hosts. VirtualBox is available in the Ubuntu repositories in the
VirtualBox's documentation provides the following advice regarding running 64-bit operating systems:
If you must use software virtualization, you can install the
Alternatively, consider running a 64-bit version of Linux instead. Ubuntu x86_64 supports running 32-bit binaries without any virtualization whatsoever.