2

I'm dual booting Windows 7 and Ubuntu on my laptop. The laptop's CPU does not support hardware virtualization. I'm using VMWare Player to allow use of my Linux partition (the same one that also runs on bare metal) from within Windows. Without hardware virtualization support, this only works with 32-bit guests, so I have 32-bit Ubuntu installed.

Occasionally, I need to run a 64-bit process under Linux and am willing to reboot to do so. I'd like to avoid having to maintain 3 separate partitions (64-bit Linux for bare metal, 32-bit Linux for virtualization, Windows 7). However, most of the time 32-bit Linux is fine for me.

Is there any reasonably simple way to install both a 64-bit and 32-bit kernel for the same Linux installation, have both kernels appear in Grub, keep most of the userland 32-bit (except for libraries and development tools, in which case I'd keep both versions installed) and allow 64-bit processes to run if I boot the 64-bit kernel on the bare metal? Ideally, I'd like to keep the default package repositories and any other relevant default settings 32-bit even when running the 64-bit kernel.

If this is not feasible, is there any other solution that wouldn't require me to either maintain two Linux partitions or upgrade my hardware?

Edit: I tried installing a 64-bit kernel on top of 32-bit Ubuntu and that works surprisingly well. However, I'd like some sane/simple way of installing 64-bit development tools and dynamic libraries, given that Apt still seems to be in 32-bit mode.

2 Answers 2

2

Ubuntu provides a small set of 64-bit libraries, starting with the libc6-amd64 Install libc6-amd64 package. Unfortunately, they don't provide a 64-bit kernel, which is necessary to execute a 64-bit binary.

You could try installing a kernel from the amd64 distribution, e.g. linux-image-2.6.32-26-server. I don't think the package management tools will let you install the package seamlessly, but you can download the .deb and install it with dpkg -i --force-architecture ….deb. In any case the package name can't be identical to that of the 32-bit kernel you have installed. You can also install the kernel without going through package management at all: unpack the .deb with dpkg-deb, put the files in place and run update-grub (if that's not precise enough instructions, I don't recommend this option). Remember to do this installation again as security updates come out (usually all kernel images are updated at the same time, so update your 64-bit kernel each time you see a 32-bit kernel update over the regular channel).

Debian does provide an amd64 kernel on the i386 architecture. So if you're willing to live with less desktop integration and a slower release cycle, you could switch to Debian.

1
  • Awesome, this pretty much worked. I guess those 64-bit libs for 32-bit distributions were pretty much designed with doing things like this in mind?
    – dsimcha
    Dec 6, 2010 at 0:30
0

If you still need some 64-bit packages, you can use debootstrap to prepare a 64-bit install and (s)chroot to it. It doesn't need to be a full install or a separate partition, just the build tools you use.

Specifically for building debian packages, pbuilder (or sbuild) can be useful. It prepares very minimal environments so that packages are built with only the dependencies they explicitly require.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .