Packetwatch.net

VMware3 in FreeBSD 5.2.1

With Windows XP as the guest OS



Last modified: Jul. 26, 2008

Contents
1 - Summary
2 - Kernel Configuration
3 - Services Configuration
4 - Application Configuration
5 - Virtual Machine Installation
6 - VMware Tools Installation
7 - Sound Configuration


1 - Summary

This guide will show you how to do two things: install and configure the VMware3
port in FreeBSD, and how to install Windows XP Professional as the guest OS.
With this guide you will need a few things like a VMware workstation for Linux
3.0 license, and a Windows XP Professional CD with CD-Key.


2 - Kernel Configuration

This guide is broken down starting with instructions for the kernel, then
services, and finally for applications. The first thing to do is to check to
see if your kernel has the following options listed below. Remember to login
as root.

	options		VFS_AIO
	options		HZ=1200
	options		IPFIREWALL
	options		IPDIVERT

If these options aren't found you will have to recompile your kernel.
Information about recompiling your kernel can be found in the FreeBSD Handbook at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html.
Reboot the computer to make sure the kernel boots correctly.


3 - Services Configuration

Next, check to see if the /etc/rc.conf file has the following options listed
below. If not, add them.

	linux_enable="YES"
	gateway_enable="YES"
	firewall_enable="YES"
	firewall_type="OPEN"
	natd_enable="YES"
	natd_interface="xl0"
	natd_flags=""

xl0 is being used as an example network interface card. Information about what
the following options mean can be found in the FreeBSD Handbook at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-natd.html.

Now, we will set the firewall rules. Before we set the firewall rules make a
backup of the /etc/rc.firewall file. Clear everything from the rc.firewall
file. Add the following to the file:

	fwcmd="/sbin/ipfw"
	${fwcmd} -f flush
	${fwcmd} add divert natd all from any to any via xl0
	${fwcmd} add pass all from any to any

Reboot the computer to make sure the firewall rules work, and that you still
have Internet access.


4 - Application Configuration

After the reboot login as root again. We can now go about installing VMware.
In order to install VMware3 we also need to set up Linux compatibility mode.
First, install linux_base.

# cd /usr/ports/emulators/linux_base
# make install && make clean

Next, we have to install rtc. RTC is a kernel module that provides /dev/rtc
device support.

# cd /usr/ports/emulators/rtc
# make install && make clean

VMware3 can now be installed. Like before, we start by compiling it.

# cd /usr/ports/emulators/vmware3
# make

During the compiling phase you will be asked a few questions.

	1) Do you want to configure vmnet interface? Yes/No
		Answer Yes
	2) Do you want to use netgraph bridging? Yes/No
		Answer No
	3) What will the IP address of your host on your private network?
		I like to use 192.168.1.1
	4) What will be the netmask of your private network?
		I like to use 255.255.255.0

At the end there is a confirmation screen that shows you your configuration.
NOTE: Configuration: host only

Next, we install it.

# make install

Finally, we clean up the leftover files.

# make clean

After the installation is complete type:

# /usr/local/etc/rc.d/001.vmware.sh start

Now, run ifconfig to see the new interface: vmnet1. Then, run kldstat to make
sure the proper modules are running for VMware. You should see:

	linprocfs.ko
	linux.ko
	vmmon_up.ko
	vmnet.ko
	if_tap.ko
	rtc.ko

Add the following line to /etc/fstab so that the linprocfs is mounted every
time FreeBSD is started.

	linproc		/compat/linux/proc	linprocfs	rw	0	0

The following line needs to be added to /etc/sysctl.conf. After you've added
the line reboot.

	kern.ipc.shm_allow_removed=1

After rebooting FreeBSD, login as a normal user. Now is the time to configure
VMware. Before running the configuration wizard, make sure that the user that
will be running VMware has read and write access to the directory where the
virtual machine will be installed. This can be done by logging in as root, then

# chmod 775 /vmware

I like to use /vmware so I know what it's for. After entering the chmod command
you can log out. Now, we will create a Windows XP Professional configuration.
First, log in as the normal user and run:

# /usr/local/lib/vmware/bin/vmware-wizard &

- Choose Create standard virtual machine.
- Choose Windows XP Professional for the guest operating system.
- Specify a directory for the virtual machine.
	example: /vmware/winXPPro/
- On the next screen choose Create a new virtual disk.
- Specify the virtual disk size.
- Specify your CD-ROM drive. Don't use the default /dev/cdrom
	example: /dev/acd1
- Specify your floppy drive.
	example: /dev/fd0
- Choose the host-only network option.
- The final screen shows your configuration. NOTE: The location of your
  configuration files.
  	example: /vmware/winXPPro/winXPPro.cfg


5 - Virtual Machine Installation

Start VMware by typing: vmware &. When running VMware for the first time, it
prompts you for your license information. You will need to enter you Serial
Number, Name, and Company Name. Next, choose Open an existing configuration. An
example is: /vmware/winXPPro/winXPPro.cfg. You can now change some of the settings in
the Settings menu under Configuration Editor.

After your done making any changes put the Windows XP Professional CD in the
CD-ROM drive, and click the button labeled Power On. There will be a few dialog
boxes that come up, but just click OK and continue on. Continue with the
installation program as normal until you get to the network settings screen.

When the network settings screen comes up select custom settings. Double-click
on Internet Protocol (TCP/IP). Remember when installing VMware3 the following
settings were used:

	IP address: 192.168.1.1
	Subnet mask: 255.255.255.0

Now enter the following addresses for Windows XP Professional:

	IP address: 192.168.1.2
	Subnet mask: 255.255.255.0
	Default route: 192.168.1.1

	For the DNS server addresses look at the /etc/resolv.conf file.

Now continue on with the installation program.


6 - VMware Tools Installation

VMware Tools installs SVGA drivers so you can run the virtual machine at a
higher resolution like 1024 x 768 or higher. After installation is complete,
log into Windows XP Professional as Administrator. Press Control-Alt-Escape. Click
VMware Tools Install under the Settings menu. Click back in the virtual
machine, and the VMware Tools setup program should have started. Finish running
the setup program. Now, you will be able to change the resolution to a higher
setting. That's it, now you have Windows XP as a guest operating system complete
with Internet access.

7 - Sound Configuration

Click on Configuration Editor under the Settings menu. Select Sound and make sure
it says /dev/dsp and that Start Connected is selected. Finally, click on Install.
Log into Windows XP Professional as Administrator. Open the Add Hardware Wizard.
Select add a new hardware device, then choose Sound, video and game controllers.
Choose Creative Technology Ltd. as the manufacturer, and Sound Blaster 16 or
AWE32 or compatible (WDM) as the model. After the installation is complete,
reboot. Now, when you login, sound should work.


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2024.