Packetwatch.net

VMware2 in FreeBSD 4.x: How to install and configure VMware

with Windows 2000 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


1 - Summary

This guide will show you how to do two things: install and configure the VMware2
port in FreeBSD, and how to install Windows 2000 Professional as the guest OS.
With this guide you will need a few things like a VMware workstation for Linux
2.0 license, and a Windows 2000 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		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

After the computer reboots login as root. 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 VMware2 we also need to set up Linux compatibility mode.
First, install linux_base.

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

Now, VMware2 can be installed. Like before, we start by compiling it.

# cd /usr/ports/emulators/vmware2
# make

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

	1) Do you want to use netgraph bridging? Yes/No
		Answer No
	2) What will the IP address of your host on your private network?
		I like to use 192.168.2.1
	3) 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/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:

	vmmon_up.ko
	if_tap.ko
	linux.ko

Add the following line to /etc/fstab so that the linprocfs is mounted every
time FreeBSD is started. After you've added the line reboot.

	linproc		/compat/linux/proc	linprocfs	rw	0	0

After rebooting FreeBSD, we add the VMware license to the VMware directory. Log
in as a normal user.

# cd ~
# mkdir /home/analyzer/.vmware
# mv license.ws.2.0 /home/analyzer/.vmware/

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 /windows

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

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

- Choose Create standard virtual machine.
- Choose Windows 2000 for the guest operating system.
- Specify a directory for the virtual machine.
	example: /windows/
- On the next screen choose New virtual disk.
- Specify the virtual disk size.
- Specify your CD-ROM drive. Don't use the default /dev/cdrom
	example: /dev/acd1c
- 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: /windows/win2000.cfg


5 - Virtual Machine Installation

Start VMware by typing: vmware &. Choose Open an existing configuration. An
example is: /windows/win2000.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 2000 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 VMware2 the following
settings were used:

	IP address: 192.168.2.1
	Subnet mask: 255.255.255.0

Now enter the following addresses for Windows 2000 Professional:

	IP address: 192.168.2.2
	Subnet mask: 255.255.255.0
	Default route: 192.168.2.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. After installation is complete, log into
Windows 2000 Professional as Administrator. Press Control-Alt-Escape. Click
VMware Tools Install under the Settings menu. Click back in the virtual machine,
click on My Computer, then the Floppy drive (A:\). Run VMwareTools.exe. Install
the software, then reboot Windows 2000 Professional. When you restart, you will
be prompted for the location of the drivers. Now press Control-Alt-Escape, then
click VMware Tools Install under the Settings menu, Next, go back into Windows
2000 Professional and type: A:\WIN2K and hit OK. Reboot Windows 2000
Professional one last time. Now when you log back in, you can change the
resolution to a higher setting. That's it, now you have Windows 2000 as a guest
operating system complete with Internet access.


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