Presently, I now need to support a Ubuntu x86_64 environment. Several internal Debian packages I have must now be deployed onto the 64-bit, split lib Ubuntu environment. Sadly, I have no 64-bit build host presently. Fortunately, QEMU provides a solution.
QEMU is best explained by quoting from the QEMU project pages.
QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation.
QEMU can emulate a full system’s peripheral stack, allowing you to interesting things like run a 64-bit clean distribution of GNU/Linux on top of an existing 32-bit CPU system such as my build host currently contains. Obviously, emulation is much slower than running natively, so this is not necessarily a good long term option and 64-bit AMD x86_64 CPUs are less expensive than they once were.
In either case, the process is fairly straight forward. I backported a coy of QEMU v0.8.1 from Debian Etch to Sarge, though with Etch being released hopefully soon, that will soon be unnecessary. Then, I downloaded the x86_64 variant of Ubuntu 6.06.1, my target environment, and pointed QEMU at it after creating a small qcow image.
# apt-get install qemu $ qemu-img create -f qcow ubuntu64.img 2G $ qemu-system-x86_64 -cdrom ubuntu-6.06.1-server-amd64.iso -hda ubuntu64.img -m 256 -boot d
The above will mount the Ubuntu CD image and present the qcow image to the OS when it boots. Once booting is complete, Ubuntu can be installed as usual, though the process is quite slow. On my system it took roughly four hours to complete. For some reason aptitude zombied, but after killing some processes installation continued and completed. The reboot failed, as the system must now be started with a new boot target.
$ qemu-system-x86_64 -cdrom ubuntu-6.06.1-server-amd64.iso -hda ubuntu64.img -m 256 -boot c
I then configured the system to be accessible from a serial console, at which point everything was happy. Using the SDL based X Window interface was creating unnecessary cycles.
qemu-system-x86_64 -cdrom ubuntu-6.06.1-server-amd64.iso -hda ubuntu64.img -boot c \ -nographic -serial stdio -monitor stdio -k en-us
Afterwards, I configured a Ubuntu pbuilder environment within the image. The process is nearly identical to the pbuilder backporting process I describe for Debian systems.
Clearly, not the fastest way to configure an environment that allows for building x86_64 ready packages, but it works.
One Comment
How many ponies were punished during the process?