Packetwatch.net

VMware3 in FreeBSD 5.3

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.

	options		VFS_AIO
	options		HZ=1200
	device		pf
	device		pflog

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.

	natd_enable="YES"
	natd_interface="xl0"
	pf_enable="YES"
	pflog_enable="YES"
	inetd_enable="YES"
	gateway_enable="YES"
	linux_enable="YES"

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/firewalls.html.

The /etc/inetd.conf file needs to be edited since we will be using it. Comment
out every line except the line on ftp-proxy. Edit this line to look like the this.

	ftp-proxy	stream	tcp	nowait	root	/usr/libexec/ftp-proxy	ftp-proxy -n

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

	ext_if = "xl0"
	network = "192.168.0.0/16"
	nat_protocols = "{ icmp, tcp, udp }"
	set loginterface $ext_if
	scrub in  on $ext_if all
	scrub out on $ext_if all random-id
	nat on $ext_if inet proto $nat_protocols from $network to any -> ($ext_if)
	rdr on $ext_if inet proto tcp from $network to any port 21 -> 127.0.0.1 port 8021
	pass in  all
	pass out all

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


4 - Application Configuration

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. Check to see if
you already have it installed, if not install it.

# pkg_info | grep linux_base
# cd /usr/ports/emulators/linux_base
# sudo make install
# sudo make clean

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

# cd /usr/ports/emulators/vmware3
# sudo 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 and clean up.

# sudo make install
# sudo make clean

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

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:

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

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 doing the following.

# sudo chmod 775 /vmware

I like to use /vmware so I know what it's for. Now, we will create a Windows XP
Professional configuration.

# /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/acd0
- 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. You might want to change the
amount of memory to 256 MB.

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-2017.