Home > Linux > HOWTO — vmware and AMD64

HOWTO — vmware and AMD64

December 18th, 2005 Leave a comment Go to comments

My aging 1GHz PC was creak­ing under ths strain of run­ning too many vir­tual PCs. So I decided to upgrade to a much bet­ter, faster PC. I even­tu­ally set­tled on an AMD64 based PC, (200G HD, 3G DDR2 RAM). Basi­cally a nice cool, (lit­er­ally as well), box. The only trou­ble 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 var­i­ous rea­sons I decided to not run Linux in full blown user­space 64bit mode. There­fore, build­ing the vmware mod­ules for net­work­ing, etc wasn’t straight­for­ward and was the main cause of my trou­bles. So I adopted a chroot/install/build/copy approach. This has worked for me not only for cross-compiling, but also run­ning dif­fer­ent Linux dis­tros natively under Debian.

Pre-requisites

  • One stock Debian Sarge install.
  • % apt-get install cde­boot­strap debootstrap

Setup chroot’ed 64bit Debian

This was pretty basic. Once you have installed deboot­strap, 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 mir­ror clos­est to you, and also choose an alter­na­tive base direc­tory, (I set mine to /STUFF/CHROOT64/).

You will see Debian installing under your chroot direc­tory, it’ll take a while. It took around 3 min­utes for me, your mileage may vary.

Con­fig­ure chroot’ed base

Once you’ve fin­ished installing, you’ll need to con­fig­ure 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 repos­i­tory. Copy the fol­low­ing into your /STUFF/CHROOT64/etc/apt/sources.list file, and mod­ify 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 fin­ish 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 ques­tions. Just answer them to mir­ror your base Debian install.

Setup build env. for vmware

Now you have a fully work­ing 64bit userp­sace 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 ker­nel mod­ules as opposed to using gcc-3.3, which is the rea­son for re-symlinking /usr/bin/gcc.

Install the all-important ker­nel 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 ques­tions as you would nor­mally. Every­thing should com­pile and install OK. The final restart of the ker­nel mod­ules won’t. You’ll get some error that you can safely ignore.

Don’t worry, you won’t actu­ally be run­ning vmware from this envi­ron­ment, just build­ing the ker­nel 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 impor­tant. Oth­er­wise 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.

Categories: Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.