VMware Tools for FreeBSD

Một phần của tài liệu the book of vmware - the complete guide to vmware workstation (2002) (Trang 114 - 117)

VMware Tools for FreeBSD include the same components as the other VMware Tools packages: an improved graphics driver, a Toolbox program for interacting with the host operating system, and dual configuration utilities. To install the tools, follow these steps:

1.

Select VMware Tools Install from VMware Workstation’s Settings menu.

2.

Attach the CD−ROM to your system:

mount /cdrom

3.

Extract the archive and unmount the CD−ROM image:

cd /tmpzcat /cdrom/vmware−freebsd−tools.tar.gz | tar xvf − umount /cdrom

4.

Change to the install directory and run the installer:

cd vmware−tools−freebsd ./install.pl

5.

The installer asks where your X server is, where the link to the server binary is, and where the configuration file is. The default locations start with /usr/X11R6, the standard for FreeBSD systems.

If you’re running XFree86 4.1 or later, answer /tmp so that the Tools installer won’t overwrite your current X server. If you don’t have the X Window System installed on the FreeBSD guest, any answer is fine.

6.

Before changing your system configuration, the installer tells you what files it will change. After you’ve read the list, press enter.

7.

Test the installation: Run the X server with the command X. If VMware Workstation switches to a high−resolution graphics mode, your server works (press ctrl−alt−backspace to kill the server). If the installation doesn’t work, you need to tweak your X server a little; see the next two sections.

7.3.1 The VMware X Server

To enable the optimized graphics drivers on FreeBSD, the VMware Tools installer does the following in /usr/X11R6/bin:

Installs XF86_VMware, the VMware X server.

Renames X as X.org.

Links X.vm to XF86_VMware (a symbolic link).

Links X to X.vm (a symbolic link).

In FreeBSD, the X server configuration file for XFree86 3.x is /etc/XF86Config. The VMware Tools installer supplies a new XF86Config.vm file, renames your original configuration file as XF86Config.org, and links XF86Config to XF86Config.vm.

The biggest issue is that you must change the resolution in the XF86Config.vm file to suit your monitor. The procedure is identical to the procedure for a Linux guest system, described in section 6.5.3; in the Screen section, comment out the current Modes setting and uncomment the one you want to use.

7.3.2 XFree86 Version 4

If you want to use XFree86 4.x with a FreeBSD guest operating system, use XFree86 4.1 or later. These versions include the VMware SVGA driver module. Configuration is the same as that for XFree86 4 in Linux, described on page 102, except for the mouse configuration, which should look like this:

Option "Protocol" "Auto"

Option "Device" "/dev/psm0"

Or if you enable moused (see section 7.9.9), it should look like this:

Option "Protocol" "Auto"

Option "Device" "/dev/sysmouse"

7.3.3 The VMware Toolbox

The companion to the VMware X server is the Toolbox (vmware−toolbox), a graphic interface to some of VMware’s features. The Tools installer places vmware−toolbox in /usr/X11R6/bin if that directory exists.

You can’t run the Toolbox outside the X Window System.

The Toolbox generally works as described in section 4.11.1. The Devices tab lets you connect and disconnect devices; you can also shrink a virtual disk, and do a few other things.

Note As with the Linux Toolbox described in section 6.5.6, you must run vmware−toolbox in your FreeBSD guest system to take advantage of certain virtual machine features, such as copying and pasting between guest and host systems and automatic release of the input focus when the mouse pointer leaves the virtual machine. Therefore, place the proper Toolbox command in your .xinitrc or .xsession file that runs every time you start a session.

7.3.4 Single and Dual Configuration

As discussed in earlier sections, when the VMware Tools installer runs, it renames a few of your original configuration files with a .org extension and creates new ones with a .vm suffix. These correspond to the original and virtual machine configurations. If you used a raw disk to run a previously installed FreeBSD installation under VMware Workstation, you have a dual configuration: one for your real hardware, and the other for VMware’s virtual hardware. The VMware Tools for FreeBSD support automatic dual configuration at boot time.

Even if you don’t have a dual configuration, you still need to know about the .vm files, because they are the active set on your system.

FreeBSD uses much simpler boot scripts than the System V init scripts found on other versions of Unix, such as Solaris and Linux distributions. These include a master script, /etc/rc, which may call other /etc/rc.* scripts (note that these are scripts, not directories on FreeBSD), and two master configuration files for the rc* scripts, /etc/defaults/rc.conf (BSD−wide defaults) and /etc/rc.conf (for customizations on your local machine).

The VMware Tools installer moves /etc/rc.conf to /etc/rc.conf.org and creates a new /etc/rc.conf.vm file based on the original; then it makes a symbolic link from the rc.conf.vm file to rc.conf:

lrwxr−xr−x 1 root wheel 15 Mar 21 15:06 /etc/rc.conf −> /etc/rc.conf.vm

−rw−r−−r−− 1 root wheel 516 Mar 20 02:09 /etc/rc.conf.org

−rw−r−−r−− 1 root wheel 515 Mar 20 02:31 /etc/rc.conf.vm

The first difference between the .vm files and the .org files is that the installer sets

moused_enable="NO"

to ensure that moused won’t interfere with the X server when you start it (this isn’t strictly necessary; see section 7.4.9 to see how to get moused and the X server to cooperate).

If you enabled host−only networking for your virtual machine, here is another handy configuration option to turn off the mailer daemon and make booting a bit quicker:

sendmail_enable="NO"

If you have a dual configuration, you will need to change the Ethernet configuration in the rc.conf.vm file. For example, if your real hardware is a DEC Tulip−based card using the de0 interface, you should have a line like this:

ifconfig_de0="10.34.21.144 netmask 255.255.255.0"

Under VMware, FreeBSD won’t see that de0 interface, because it knows about another kind of driver with a different name, lnc. Therefore, change the line to something like

ifconfig_lnc0="172.16.144.100 netmask 255.255.255.0"

or

ifconfig_lnc0="DHCP"

Note Your particular changes will depend on how you configured VMware networking, which we’ll discuss in more detail in Chapter 9.

The Boot Process

To run the .vm or .org files at boot time, the VMware Tools installer tries to add a few lines to /etc/rc. They look something like this:

### <InstalledByVMware> ### Do not edit this tag!

# ...

ldconfig −elf /usr/lib /usr/lib/compat /etc/vmware−tools/dualconf.sh start

### </InstalledByVMware> ### Do not edit this tag!

The /etc/vmware−tools/dualconf.sh script uses a program called checkvm to see whether the operating system is running inside of VMware. If it is, checkvm enables the scripts and configuration files that end with .vm.

Otherwise, it activates the .org scripts and files. The checkvm program works like its Linux counterpart, described in section 6.5.7.

Note Take a close look at /etc/rc. If the script says $install_dir/dualconf.sh instead of

/etc/vmware−tools/dualconf.sh, change it to the latter. (The script is incorrect because of a bug in some versions of the Tools installer.)

In addition to making sure that the dual configuration scripts are set up correctly, you must make sure that your kernel supports both your real hardware and VMware’s hardware, usually by compiling all of the drivers that you need into the kernel. Although this may not be possible with certain combinations of drivers (such as those for sound cards), for important devices such as disks, you should be able to do so without a problem.

Một phần của tài liệu the book of vmware - the complete guide to vmware workstation (2002) (Trang 114 - 117)

Tải bản đầy đủ (PDF)

(214 trang)