HOWTO — vmware and AMD64
My aging 1GHz PC was creaking under ths strain of running too many virtual PCs. So I decided to upgrade to a much better, faster PC. I eventually settled on an AMD64 based PC, (200G HD, 3G DDR2 RAM). Basically a nice cool, (literally as well), box. The only trouble is that I couldn’t get my vmware to run. Aaaaaaaaaaargh. This is a short howto on what I had to do to get it to run.
First up
For various reasons I decided to not run Linux in full blown userspace 64bit mode. Therefore, building the vmware modules for networking, etc wasn’t straightforward and was the main cause of my troubles. So I adopted a chroot/install/build/copy approach. This has worked for me not only for cross-compiling, but also running different Linux distros natively under Debian.
Pre-requisites
- One stock Debian Sarge install.
- % apt-get install cdebootstrap debootstrap
Setup chroot’ed 64bit Debian
This was pretty basic. Once you have installed debootstrap, then just run:
% cdebootstrap --arch amd64 sarge /STUFF/CHROOT64/ http://public.planetmirror.com/pub/debian-amd64/debian/
You will have to select a Debian 64 mirror closest to you, and also choose an alternative base directory, (I set mine to /STUFF/CHROOT64/).
You will see Debian installing under your chroot directory, it’ll take a while. It took around 3 minutes for me, your mileage may vary.
Configure chroot’ed base
Once you’ve finished installing, you’ll need to configure it all up. I did so with the following:
% cp /etc/hostname /etc/resolv.conf /etc/mtab /etc/fstab /STUFF/CHROOT64/etc % cp /etc/network/interfaces /STUFF/CHROOT64/etc/network
You’ll also need to setup your apt-get repository. Copy the following into your /STUFF/CHROOT64/etc/apt/sources.list file, and modify for your own mirror.
deb http://public.planetmirror.com/pub/debian-amd64/debian/ sarge main contrib non-free deb-src http://public.planetmirror.com/pub/debian-amd64/debian/ sarge main contrib non-free # deb http://security.debian.org/ stable/updates main contrib non-free
Then enter your chroot and finish the configure.
% chroot /STUFF/CHROOT64 % mount /proc % base-config % dpkg-reconfigure -plow console-data
The ‘base-config’ will take a while and ask the usual setup questions. Just answer them to mirror your base Debian install.
Setup build env. for vmware
Now you have a fully working 64bit userpsace chroot env. You’ll need a few more tools apart from the base install:
% apt-get update % apt-get install gcc-3.4 % rm /usr/bin/gcc % ln -s /usr/bin/gcc-3.4 /usr/bin/gcc
NOTE: VMWare will want to use gcc-3.4 to build the kernel modules as opposed to using gcc-3.3, which is the reason for re-symlinking /usr/bin/gcc.
Install the all-important kernel headers:
% apt-get install kernel-headers-2.6-amd64-generic
Install vmware
Now, untar the vmware install file. Run the vmware-install.pl script. Answer all those questions as you would normally. Everything should compile and install OK. The final restart of the kernel modules won’t. You’ll get some error that you can safely ignore.
Don’t worry, you won’t actually be running vmware from this environment, just building the kernel modules.
Copy VMware install into base install
Now copy all the vmware install files into the base Debian installation:
% cd /STUFF/CHROOT64 % tar -cf - usr/lib/vmware etc/vmware usr/share/doc/vmware usr/bin/vmware* lib/modules/2.6.8-11-amd64-generic/misc etc/init.d/vmware etc/rc?.d/*vmware | (cd /; tar xvf -) % rm /etc/vmware/not_configured % rsync -HvaxP dev/vm* /dev
NOTE: The removal of the /etc/vmware/not_configured file is important. Otherwise you won’t be able to start the vmware modules.
Startup vmware modules
Just run the rc script.
% /etc/init.d/vmware restart
That’s it! Happy vmware-ing!
No related posts.
