The Complete Guide to VMware Workstation
Brian Ward
This book is about the VMware Workstation product: how to use it, how to set up its guest operating systems, and the things you can do with these systems once you have them up and running. VMware Workstation functions as a computer within a computer, so that you can start up an entire operating system and run any programs for that operating system with it, while keeping your original operating system environment intact (and usable). For example, a Linux user who needs to use a Windows program not available for Linux (such as a map downloading system for a Palm’s GPS) can fire up VMware Workstation in a window, start Windows NT there, run the mapping software, download the maps to the Palm using the
virtual serial port (connected to the real serial port on Linux), and then put Windows away for another time. It can work the other way around, too—Windows users needing Linux applications can run them in a virtual machine. And that’s just the beginning.
VMware is a virtual machine (VM) for an Intel Pentium−class or higher machine and is available for the Windows NT, Windows 2000, Windows XP, and Linux operating systems. Virtual machine software runs on a real machine and provides a virtual machine with the same basic architecture as the real machine. The architecture is based on the processor typ—for example, the i686 (Intel Pentium II/III) and sun4u (Sun UltraSPARC) are two different architectures. On the surface, VMware Workstation is similar to an emulator (a machine running only in software), but there is a crucial difference between a VMware−style virtual machine and an emulator. Whereas an emulator intercepts and interprets every last instruction for the target machine, a virtual machine passes most of the work down to the real machine sitting beneath it. Because the real machine is much faster than a software
emulator, programs running on a real machine run much faster and efficiently than they do on an emulator. In addition, you needn’t worry so much about compatibility issues as you would with an emulator—the real processor isn’t likely to make a mistake.
A computer’s processor is tightly coupled to its memory (RAM). VMware takes advantage of memory management techniques used in contemporary operating systems to keep this coupling in place on virtual machines.
However, there has to be emulation in a virtual machine at some level, or the virtual machine would just take over the whole computer. In VMware Workstation, the emulation comes in two places: peripheral hardware (disks, network cards, and so on) and certain privileged CPU instructions. However, even though VMware’s hardware is at the software level, you can map your real hardware to the virtual hardware so that you can use
the real hardware on the virtual machine just as you normally would. Of course, this takes a small bit of overhead because the communication between the real hardware and the virtual machine has to go through a few more layers, but this abstraction also enables certain features that more than make up for it.
(A specific example is device disconnection and reconnection.)
Introduction
Who Should Read This Book
This book strives to be a complete how−to and reference guide for VMware Workstation. Each chapter starts with a hands−on, step−by−step guide to getting one piece of the puzzle up and running. Then the material shifts into reference−style documentation. Because VMware Workstation runs such a wide range of operating systems, it’s natural that some material will be a review to almost any reader. However, this material will be different for every user, depending on the operating systems with which the reader is most familiar.
Because VMware multiplexes a PC, this book discusses pertinent hardware and operating system elements. If you “sort of know” these concepts but are hazy on a few details (such as how a PC boots), you might pick up some of this information along the way. Remember, however, that this book is about VMware and doesn’t stray from that theme.
This book is probably not for people who have never used any of the operating systems in the book, or for very advanced users who have used every single operating system ever produced.
This book strives to be a complete how−to and reference guide for VMware Workstation. Each chapter starts with a hands−on, step−by−step guide to getting one piece of the puzzle up and running. Then the material shifts into reference−style documentation. Because VMware Workstation runs such a wide range of operating systems, it’s natural that some material will be a review to almost any reader. However, this material will be different for every user, depending on the operating systems with which the reader is most familiar.
Because VMware multiplexes a PC, this book discusses pertinent hardware and operating system elements. If you “sort of know” these concepts but are hazy on a few details (such as how a PC boots), you might pick up some of this information along the way. Remember, however, that this book is about VMware and doesn’t stray from that theme.
This book is probably not for people who have never used any of the operating systems in the book, or for very advanced users who have used every single operating system ever produced.
Terms and Conventions
Now let’s get to some terms and notation that you’ll see throughout this book:
Host System: This is the computer and operating system that runs VMware—in other words, the computer you install VMware Workstation on. Host operating system refers to only the operating system side of your host system.
Guest System: The virtual machine and operating system running inside VMware. Under VMware Workstation, each host system may have several guest systems. Guest operating system refers to only the operating system on the guest system.
Boot and Reboot: The computer’s boot procedure loads the operating system. Rebooting is simply shutting the operating system down and starting it up again. Some operating systems use the terms start and restart for these actions. We’ll use the terms boot and reboot to avoid confusion because you can also start and restart processes on a running system. (The term boot comes from the metaphor of a system “pulling itself up by its bootstraps,” though the computer sometimes doesn’t do all the work by itself.)
Text in a monospaced typeface like this normally refers to something that you type at a Unix/Linux or DOS prompt, or something that you see on the screen. Sometimes it can be a file name on these systems. The important thing to remember is that monospaced text normally refers to something in a command−line interface.
On the other hand, menu sequences appear like this: File • Save. Menu sequences refer to a graphical user interface: For example, “pull down the File menu and select the Save option.”
Book Layout
This book’s organization follows the order of topics that a new VMware user encounters. Since there are many different combinations of host and guest operating systems, the information is laid out in such a way that you can skip ahead to another chapter when you’ve learned enough. For example, let’s say you run VMware Workstation for Windows and want to run FreeBSD as a guest operating system. You can go over the information pertinent to Windows in Chapter 3, skip to Chapter 4, read about the Configuration Wizard and VMware’s operation there, and then skip past the next two chapters to end up at the FreeBSD guest information in Chapter 7. After you become more familiar with VMware, you can go back to Chapter 4 and read about the Configuration Editor.
Before this book goes into much detail about how to use VMware Workstation, we discuss the virtual hardware in Chapter 2. Because not all users may be familiar with real hardware, each section briefly explains a PC’s real hardware before describing what VMware provides. This chapter also discusses a few other topics, such as the PC BIOS.
Chapter 3 describes how to install VMware Workstation on your host system and the issues you may encounter in the process. Because VMware requires access to some of the host system’s internal data structures, you may need to change your system’s configuration. Although this discussion applies mainly to VMware Workstation for Linux, you’ll find information about the Windows versions as well.
In Chapter 4, you’ll learn how to set up a virtual machine configuration and get acquainted with VMware’s user interface. VMware provides two configuration tools: the Configuration Wizard and Configuration Editor. You’ll get started with the wizard and then learn how to operate the VMware controls. This chapter also introduces a set of very important packages called the VMware Tools and tells you how to use the pieces common to all guest systems. Reference material in Chapter 4 also includes the Configuration Editor and the VMware BIOS.
Chapters 5 through 8 are devoted to guest operating systems. Most of the content in these chapters is devoted to device support—in particular, how to set up the devices in each guest system. Depending on the guest system, you may need to know something about the system beforehand. Although the Windows systems don’t have many prerequisites, you’ll need a little familiarity with the Unix shell interface for the Linux and FreeBSD chapters. Fortunately, VMware offers you the opportunity to learn as you go. If you install Linux as a guest on a VMware virtual disk, you can’t damage your host system while you play around with the Linux
system, and you can even set your virtual disk to an “undoable” mode.
You’ll find information about Windows 95, 98, Me, NT, 2000, and XP in Chapter 5. Older Microsoft systems such as DOS 6 and Windows 3.1 also run under VMware; this book covers these as well. Chapter 6 is devoted to Linux; Chapter 7 describes FreeBSD under VMware. Other operating systems that work (to some degree, at least) with VMware Workstation are discussed in Chapter 8. Networking is one of VMware’s strong points, and Chapter 9 goes into detail about how to set it up on your host and guest systems. Because there are many different possible configurations, the entire chapter is devoted to setup.
Once you get your network up, you’ll want to do something with it. One of the most common network tasks with VMware is sharing the host filesystem with the guest system, and naturally, this book covers the procedure. However, there are many things you can do above and beyond simple file sharing; you’ll learn which ones are of particular interest with respect to VMware in Chapter 10. Chapter 11 is a small guide to transferring files between host and guest systems without the help of a network.
Finally, Chapter 12 contains troubleshooting information. Since VMware Workstation acts like a real computer, it can have many of the same sorts of problems. This chapter discusses these potential problems following the same sequence as the rest of the book.
Appendix A provides hints on setting up video modes on a Linux host system. Because this is a somewhat tangled subject, and its relevance to VMware is tangential, it does not appear within the main text. However, if it did, it would be in Chapter 4, near the discussion of full−screen mode. Appendix B covers upgrades to VMware Workstation 3 from a previous version.
Table of Contents
Chapter 1: Introduction.......................3
Overview..................3
1.1 Who Should Read This Book.................3
1.2 Terms and Conventions.............4
1.3 Book Layout.......................4
1.4 VMware Applications......................6
1.4.1 Quality Assurance (QA)...................6
1.4.2 Network Programming and Testing.............6
1.4.3 Operating System Development, Research, and Education.................7
1.4.4 Other VMware Products.....................7
Chapter 2: The VMware Virtual Machine................8
Overview..........................8
2.1 Processor, Bus, Memory, and Interrupts.................8
2.2 The VMware Devices..................9
2.2.1 IDE Disks and CD−ROM Drives...............9
2.2.2 SCSI Disks..........................10
2.2.3 Floppy Drives.......................11
2.2.4 Ethernet Interfaces.....................11
2.2.5 Serial Ports............................12
2.2.6 Parallel Ports...................12
2.2.7 USB Interface.................13
2.2.8 Graphics................................13
2.2.9 Mouse..............................13
2.2.10 Sound Cards.............14
2.3 PC BIOS...................14
2.4 How a PC Boots...................15
Chapter 3: Installing VMware Workstation.............16
Overview............................16
3.1 Host System Requirements....................16
3.2 Installing VMware Workstation for Windows..............17
3.2.1 Upgrading from Version 2................18
3.3 Starting VMware for Windows..................18
3.4 VMware Workstation for Windows Files...............19
3.5 Uninstalling VMware for Windows...............19
3.6 Installing VMware Workstation for Linux....................20
3.7 Configuring VMware Workstation for Linux...............22
3.8 Compiling VMware Kernel Modules...............24
3.9 Starting VMware Workstation for Linux................25
3.10 VMware Linux Executables..............26
vmware−config.pl.................26
vmware−uninstall.pl..........................26
vmware−wizard..................................26
vmware−nmbd, vmware−smbd, vmware−smbpasswd, vmware−smbpasswd.bin.......26
vmware−mount.pl, vmware−loop.................26
vmnet−bridge, vmnet−dhcpd, vmnet−natd, vmnet−netifup, vmware−ping........26
vmnet−sniffer......................27
3.11 VMware Linux Library Directory..................27
3.12 VMware Workstation for Linux Boot Script.........27
3.13 Additional Files in /etc/vmware and /dev........28
locations...............28
config...........................28
installer.sh........................28
/etc/vmware/vmnet Directories.....................29
not_configured...............................29
Device Files....................29
3.14 Upgrading VMware Workstation for Linux................29
Chapter 4: Virtual Machine Configuration and Operation...........31
Overview............................31
4.1 Getting Started......................31
4.2 The VMware Configuration Wizard...................31
4.2.1 Stepping Through the VMware Configuration Wizard...........32
4.3 VMware Operation.............34
4.4 Power On...................35
4.5 Toolbar Buttons.................35
4.6 VMware Menu Items................36
4.6.1 File Menu.................36
4.6.2 Power Menu...............................37
4.6.3 Settings Menu................37
4.6.4 Devices Menu................39
4.6.5 View Menu..............39
4.6.6 Help Menu.............40
4.7 Input Options................40
4.8 Suspend/Resume..............41
4.8.1 Performance Notes.......42
4.9 Full−Screen Mode......................43
4.9.1 Windows Host Display Configuration.......43
4.9.2 Linux Host Display Configuration..............44
4.10 Connecting and Disconnecting Devices..........44
4.11 VMware Tools....................45
4.11.1 VMware Tools Properties (Toolbox)..................46
4.12 The Configuration Editor.......................48
4.12.1 Windows Configuration Editor.....................48
4.12.2 Linux Configuration Editor.....................49
4.12.3 Configuration Editor Options.........49
4.12.4 Nonhardware Options..................57
4.13 Host Memory Requirements..................58
4.14 The VMware BIOS..................59
Chapter 5: Windows Guest Systems...............62
Overview......................62
5.1 Windows Driver Compatibility in a Guest System..............62
5.2 Windows NT, 2000, and XP..................62
5.2.1Navigating the Control Panels.................63
5.2.2 IDE Devices..............................63
5.2.3 SCSI Devices..............................65
5.2.4 Floppy Drives..............................65
5.2.5 Ethernet Interfaces...............................65
5.2.6 Serial Ports.....................................66
5.2.7 Parallel Ports......................................66
5.2.8 Sound Card...............................66
5.2.9 USB Controller................................67
5.3 Windows 95, 98, and Me.............68
5.3.1 Installation under VMware..............68
5.3.2 VMware Devices under Windows 95, 98, and Me..........68
5.3.3 IDE Disks...............................................69
5.3.4 CD−ROM Drives..................................70
5.3.5 SCSI Devices...................................................................71
5.3.6 Ethernet Interfaces...............................71
5.3.7 Serial Ports........................................71
5.3.8 Parallel Ports................................71
5.3.9 Mouse.............................................72
5.3.10 Sound Card.............................72
5.3.11 USB Controller.........................72
5.4 VMware Tools for Windows...............73
5.4.2 VMware Tools Properties for Windows.........................74
5.4.3 Dual Configurations and Hardware Profiles...................75
5.4.4 Setting Up Your System for Dual Configuration............76
5.5 Unix/GNU Utilities for Windows...........77
5.6 DOS and Windows 3.1.....................78
5.6.1 DOS CPU Idler Utility and APM under Windows 3.1..............79
5.6.2 IDE Disks............................79
5.6.3 CD−ROM Drive..........79
5.6.4 SCSI Devices.......................80
5.6.5 Floppy Drives......................80
5.6.6 Ethernet Interfaces...............80
5.6.7 Serial and Parallel Ports.........82
5.6.8 Mouse.................................82
5.6.9 Sound Card...........................82
5.6.10 USB Devices.......................83
Chapter 6: Linux Guest Operating Systems...........84
Overview.....................84
6.1 Running Linux as a Guest under VMware.....................84
6.2 System Requirements..............................84
6.3 Installing Linux under VMware........85
6.4 Running Existing Linux Installations under VMware.................86
6.5 VMware Tools for Linux........................87
6.5.1 Installing VMware Tools..................87
6.5.2 XFree86 Server Configuration...............88
6.5.3 Testing and Customizing the VMware X Server...........90
6.5.4 Additional VMware X Server Information................91
6.5.5 The VMware Toolbox.................91
6.5.6 The VMware Toolbox and X Startup Files...............91
6.5.7 Other VMware Tools for Linux and Dual Configuration........92
6.5.8 Using checkvm in X Startup Scripts..........94
6.6 Linux Devices...............94
6.6.1 /dev/hd*: IDE Disks and ATAPI CD−ROM/DVD Drives..........95
6.6.2 /dev/sd*: SCSI Disks...............95
6.6.3 /dev/scd*, /dev/sr*: SCSI CD−ROM Drives..........96
6.6.4 /dev/sg*: Generic SCSI Devices.........96
6.6.5 /dev/ttyS*: Serial Ports............96
6.6.6 /dev/fd*: Floppy Drives...............................96
6.6.7 /dev/lp*, /dev/parport*: Parallel Ports..................97
6.6.8 Ethernet Interfaces...................97
6.6.9 /dev/psaux: PS/2 Mouse....................97
6.6.10 /dev/dsp, /dev/audio: Sound Card.....................97
6.6.11 USB Devices.......................98
6.7 The Linux Kernel and Device Drivers...................98
6.7.1 Working with Kernel Modules..........98
6.7.2 Linux Device Drivers for VMware Workstation......99
6.8 Linux System Information............102
6.9 Booting Linux: LILO...............102
6.9.1 Method 1: New Virtual Disk..............103
6.9.2 Method 2: Fake Floppy Disk..............103
Chapter 7: FreeBSD Guest Systems.................105
Overview.....................105
7.1 Installing FreeBSD under VMware.................105
7.2 Using an Existing FreeBSD Installation under VMware...............106
7.3 VMware Tools for FreeBSD..................106
7.3.1 The VMware X Server...................107
7.3.2 XFree86 Version 4....................107
7.3.3 The VMware Toolbox.....................108
7.3.4 Single and Dual Configuration..........108
7.4 BSD Devices............109
7.4.1 ATA/IDE Disks..................110
7.4.2 ATAPI CD−ROM Drive............113
7.4.3 SCSI Devices..................114
7.4.4 Floppy Drives...................114
7.4.5 Ethernet Interfaces............114
7.4.6 Serial Ports..............114
7.4.7 Parallel Ports..........114
7.4.8 USB Devices...............115
7.4.9 PS/2 Mouse Port............115
7.4.10 Sound.......................115
7.5 Customizing a FreeBSD Kernel for VMware...........116
7.5.1 Help! My New Kernel Didn’t Work!............117
7.5.2 FreeBSD Kernel Configuration Parameters........117
7.6 The FreeBSD Boot Manager................119
7.7 FreeBSD System Statistics..............120
Chapter 8: Other Guest Operating Systems............121
Overview...................121
8.1 CPU Idle and VMware Workstation...............121
8.2 NetBSD and OpenBSD.....................122
8.2.1 Installing NetBSD...........................123
8.2.2 Installing OpenBSD....................123
8.2.3 NetBSD and OpenBSD Devices...............124
8.2.4 NetBSD Kernels.............125
8.2.5 OpenBSD Kernels.................126
8.3 Novell Netware................127
8.3.1 Configuring Your Virtual Machine and Installing Netware.........127
8.3.2 Miscellaneous Notes........129
8.4 Solaris..........129
8.4.1 Installing Solaris........129
8.4.2 Solaris Devices............130
8.4.3 Booting Solaris.....................131
8.4.4 Devices Relevant to VMware Workstation......131
8.4.5 Graphics Mode under Solaris.........133
8.4.6 Solaris 2.7...................133
8.5 FreeDOS................134
8.5.1 FreeDOS Devices................134
8.5.2 FreeDOS Installation Hints.............135
8.6 Oberon...........136
8.6.1 Oberon Installation Hints.........136
Chapter 9: Host and Guest System Network Configuration...........138
Overview.................138
9.1 VMware’s Networking Options.............138
9.1.1 Network Basics........138
9.1.2 IP............139
9.2 Bridged Networking........139
9.3 Host−Only Networking.............141
9.3.1 Host−Only IP Configuration (Host Operating System)...........141
9.3.2 Viewing and Changing Your Host−Only Network Settings.........142
9.4 VMware Host−Only and NAT DHCP Server....143
9.4.1 Creating and Customizing DHCP Configuration Files..........143
9.5 Guest Operating System Networking Configuration........144
9.5.1 Windows 95, 98, and Me...........144
9.5.2 Windows NT.............145
9.5.3 Windows 2000/XP............145
9.5.4 Linux...................145
9.5.5 FreeBSD.............146
9.5.6 NetBSD............147
9.6.1 Creating a Hosts File..................147
9.7 NAT Networking................148
9.7.1 Configuring VMware NAT Networks...............149
9.7.2 NAT Configuration for Guest Systems............151
9.7.3 Other NAT Alternatives (for Advanced Users).........152
9.8 VMnet Devices..................152
9.8.1 Linux Host...................152
9.8.2 Windows Host............153
9.9 Custom Networks...............153
9.9.1 Windows 2000/XP Host: Bridged Network...........153
9.9.2 Windows NT Host: Bridged Network..........154
9.9.3 Linux Host: All Network Types....................154
9.9.4Windows Host: Host−Only Network...........155
9.10 Ethernet MAC Addresses............157
9.11 Using the VMnet Sniffer..........158
Overview...........................159
10.1 SMB Fileserver (Linux Host)..........159
10.1.1 The SAMBA Server Side.............160
10.2 SMB Fileserver (Windows Host)..........162
10.3 SMB File Sharing Client (Windows Guest)......163
10.3.1 Using Network Neighborhood................163
10.3.2 Mapping a Network Share Folder to a Drive Letter.........164
10.3.3 Attaching a Share Directly..............164
10.4 The SAMBA File Sharing Client (Linux Guest)......165
10.4.1 Testing SAMBA and Accessing Shares......165
10.5 Network Printing..............165
10.5.1 Configuring SAMBA Printer Sharing (Linux Host)..........166
10.6 Windows Host Printer Sharing............167
10.7 Unix Guest Printing...............168
10.7.1 Printing from a Unix Guest to a Unix Host..........168
10.7.2 Printing from a Unix Guest to a Windows Host.......168
10.8 SSH Remote Shell Access for Unix Guest Systems.........170
10.8.1 Installing and Configuring the SSH Server Software............170
10.8.2 Starting the SSH Server.............171
10.8.3 SSH, Host−Only Networks, and Hostname Resolution......171
10.8.4 SSH Clients......171
10.8.5 X Client Forwarding with SSH........172
10.9 Using a Proxy Server..........173
10.9.1 Getting and Configuring Squid..............174
10.9.2 Guest System Proxy Configuration..........175
10.10 Considerations for Other Services.........176
Chapter 11: Non−Networked File Transfer..........177
Overview...............177
11.1 Disk Images.........177
11.2 Disk Image Utilities (Linux Host)................177
11.2.1 Kernel Support for the Loopback Device.................178
11.2.2 Extracting Data from Floppy Disks.............178
11.2.3 Creating New Floppy Images..................179
1.3 Floppy Disk Image Utilities (Windows Host)....................179
11.3.1 Windows File Extensions...............180
11.4 Creating CD−ROM Images..........180
11.4.1 Linux Host....................180
11.4.2 Windows Host.....................181
11.5 Accessing Guest Virtual Disks (Linux Host Only).........181
11.5.1 vmware−mount.pl Options.........182
Chapter 12: Troubleshooting.............183
Overview........183
12.1 General Troubleshooting Procedures..........183
12.1.1 Try to Identify the Part of the System That’s Causing Trouble...183
12.1.2 Diagnostic Messages and Errors..............184
12.1.3 Other Resources...............184
12.2 Problems and Solutions.................185
12.2.1 Windows Host Operating System Problems.......185
12.2.2 Linux Host Operating System Problems.........185
12.2.3 General Configuration Problems.........189
12.2.4 General Guest Operating System Problems..............190
12.2.5 Windows Guest Operating System Problems (All Versions)....192
12.2.6 Windows 95 Guest Operating System Problems.......192
12.2.7 Windows 98 Guest Operating System Problems...193
12.2.8 Windows NT, 2000, and XP Guest Operating System Problems........193
12.2.9 DOS Guest Operating System Problems....194
12.2.10 Linux Guest Operating System Problems..........195
12.2.11 VMware Tools Problems...........198
12.2.12 Networking Problems.............198
12.3 Setting Up a Recovery Guest Operating System.........199
Appendix A: Linux Display Parameters......201
Overview.........................201
A.1 XFree86 Version 3.............201
A.2 XFree86 Version 4............202
Appendix B: Upgrading from VMware Workstation 2...............204
Overview......204
B.1 Upgrading the Virtual Hardware.......204
B.1.1 Upgrading Windows Guest Systems............205
B.2 Upgrading Virtual Disks (Windows Host Only)....205