A rough guide documenting my experience installing FreeBSD 7.1 in VMware Server on Hardy Heron with a working internet connection, working audio, and some working vmware-tools (automatic mouse grab, and proper video display).Details:FreeBSD 7.1-RELEASE-i386 (Download the torrent from
freebsd.org. I recommend grabbing either the
-dvd1 option corresponding to your setup, or the
-all option and checking only the
-dvd1 and maybe documentation; there should be no need to download the other disks.
Emulator:
VMware Server 1.0.6 build-91891.Host OS:
Ubuntu Linux 8.04/Hardy HeronPre-Installation:1. I ran out of hard drive space in the VM the first time I tried to do this, and unless you plan on doing a minimal installation, I advise you to allocate at least six gigabytes for FreeBSD; if not, then I advise scrupulous caution during installation not to install extra, unneeded software during installation. You can always do that after installation by running the
sysinstall command (as root).
2. Do, however, make sure that when prompted, you install the "ports collection" (section 2.7.2 of freebsd.org's guide.) This will make adding additional software later on much easier however at the expense of about half a gigabyte. FreeBSD without the ports is sort of like having Debian or Ubuntu with the
apt-get command removed from the system. Moreover, you will need it in order to install the proper drivers.
3. Set your internet connection type inside VMware as
NAT, connected at power on (we will later enable DHCP inside the guest for this to work). Set the DVD iso file as a CD/DVD drive in the VM, also to be connected at power on.
4. Do not forget, of course, when choosing which "distribution" (
2.7.1) you would like, to select one that includes the
X Window System unless you do not wish to install a graphical user interface. I personally went with option 9, home user plus GUI, but I ended up going back and installing sources afterward.
5. In step
2.6.3, pick any option other than leaving the MBR untouched or the guest will be unable to boot. Might as well go with the standard MBR option, unless you plan on installing multiple operating systems inside the same VM.
6. You may need to hit the escape key and select CD-ROM while the VM is booting in order to boot from the iso. Choose the default option (option 1) on the FreeBSD boot screen, and read and follow the directions carefully, installing a standard installation. Refer to
freebsd.org's handbook,
Installing FreeBSD, if you are unsure of something along the way.
7. Because we are installing in a virtual machine with the bootable DVD (no floppies necessary), many of the initial, preparatory steps can be skipped. Also, because we are working in a VM you can allocate all the space in the drive to FreeBSD without worry and without getting lost in partition utilities.
Post-Installation:The first step in configuration after installing FreeBSD is a window reading "Network interface information required." For a working internet connection, select the first option, which for you may appear as
ed0 but for me was
le0. Take a note of which one it is.
You will be asked "Do you want to try IPv6 configuration of the interface?" You can choose yes here; the first time I installed, I was prompted to enable DHCP (Dynamic Host Configuration Protocol) and this gave me a connection automatically. I have since reinstalled four times trying to reproduce this situation but have not been able to. If this does not happen for you, simply type in any host name (such as
networkhost) and leave the rest of the information blank; we'll enable DHCP manually.
The first time you have access to the command prompt as root, type
ee /etc/rc.conf (ee being FreeBSD's terminal-based text editor) and add the line
ifconfig_le0="DHCP" possibly replacing
le0 with
ed0, whichever appeared in the configuration menu before. Exit by pressing the escape key, and save changes. Reboot by typing
shutdown -r now. Your internet connection should be automatically connected on reboot. You should notice the successful IP configuration while the OS is booting; otherwise, you can test it by pinging Google, for example.
To load the X Window Environment (over which you can
install your choice among KDE, Gnome, etc.) type at the command prompt,
startx. More than likely, the GUI will not load properly at this point. You can type
exit from a terminal window to revert to command line interface. On my system, the screen resolution was irregularly large, over 2000 pixels wide and about the same in height, twice the size of my host's resolution. I also received the error message from VMware:
Unable to find an appropriate host video mode. Adding the guest mode to the 'display' subsection of the 'screen' section of your /etc/X11/XF86Config and restarting X is likely to help. Failed to switch to full screen SVGA mode.
Because of this, I had to constantly use the scroll bars to see what I was doing, and could not put the guest into full screen mode. After
installing KDE, the problem continued, and KDE's screen resolution drop down menu was empty, not allowing me to change the resolution from there either.
Fortunately, installing
VMware Tools solved this problem. Unfortunately, it's not as easy as it should be. But it could be worse, and they are somewhat functional. I started by following
VMware's guide from the command line (GUI must not be loaded.)
After installation, one is asked to run the
vmware-config-tools.pl script. Upon running this script, I received an error saying
"This configuration program is to be executed in a virtual machine," even though, of course, it was being executed in a virtual machine! In order to bypass this, I booted back into KDE, because I found it difficult to this from ee, opened up
vmware-config-tools.pl in Kate and modified the script. Search the document from the begining for "invm" and the first result will bring you to an if/else script, about one-third the length of the document from the top, starting around line 2,778.
Change:
{
$gSystem{'invm'} = 'yes';
} else {
$gSystem{'invm'} = 'no';
}
To this:
{
$gSystem{'invm'} = 'yes';
} else {
$gSystem{'invm'} = 'yes';
}
I made these changes, saved the script, and quit KDE as again this script must be run outside the X Window System. I again executed the script and this time it ran beautifully. I said yes to everything, keeping default options, and allowed it to create a new
xorg.conf file. At this point I tried to load
startx, and received an error message because the drivers referred to in
xorg.conf were not present. No big deal, they're just not installed by default.
First, I installed the video driver:
cd /usr/ports/x11-drivers/xf86-video-vmware
make install clean
Then the mouse:
cd /usr/ports/x11-drivers/xf86-input-vmmouse
make install clean
Finally, typing
startx should properly boot the X Window System. There will be no guest-host shared clipboard feature to which we are accustomed in guest operating systems better supported by VMware, but BSD's GUI will now load with proper video settings, with adjustable screen resolution, the capacity to work in full screen mode, and the always very useful auto-grab capabilities for the mouse.
At this point, from any terminal inside the GUI, we are instructed run
vmware-toolbox & to finalize the configuration and adjust any additional settings. I am not sure if this is necessary as it is possible that the toolbox's features do not function at all, but I included this just in case they do succeed to implement some sort of performance enhancement.
Unfortunately it will not load by default as it relies on two old library files from a previous version of FreeBSD that have since been updated and renamed. To force it to work, we can make symbolic links, using the old names, linking to the new versions. Run the following two commands:
ln -s /lib/libc.so.7 /lib/libc.so.5
ln -s /lib/libm.so.5 /lib/libm.so.3
At this point, you should be able to launch
vmware-toolbox. It will at least give you the option of a few additional features, such as clock synchronization with the host. I had thought this was working on my system but unfortunately I was incorrect, the clocks do not synchronize, but it is at least worth the try.
Finally, for audio, make sure you have added an audio device in the VM settings. Likely, you will not be getting any audio and/or are receving the error:
Error while initializing the sound driver: device /dev/dsp can't be opened (NO such file or directory) The sound server will continue, using the null output device.
To fix this, open up in any text editor the file
/boot/loader.conf and add the following line:
snd_es137x_load="YES"

Reboot, and you should now have working audio in your BSD guest, giving you the final step in what should be a more or less perfectly running FreeBSD installation.
Please excuse any mistakes or unnecessarily lengthy workarounds as this article, which is basically a diary of the last 40-something hours of my life, is my first experience with FreeBSD.
I hope this was of use to someone. At least let me know if it was, so I know it was worth the time typing it! Good luck!