Contents

Switching Ethernet Adaptors in a Virtual Machine

You may find it helpful to configure a virtual machine so it can use one virtual switch or Ethernet adapter when you are in one location and a different virtual switch when you are somewhere else. The most common case would involve a laptop computer that is sometimes used with a PC Card (PCMCIA) adapter and sometimes docked in a docking station that has its own physical network adapter.

If you are using bridged networking, the steps covered in this topic will allow you to configure your virtual machine so it can use both physical network adapters, with each physical adapter connected by a different virtual switch.

You will create two separate Workstation configuration files ( .cfg files), both of which point to the same virtual or raw disk. One will use standard bridged networking on the VMnet0 virtual switch. The other will use custom bridged networking on the VMnet2 virtual switch. You will use one configuration when you want to connect to a network using the PC Card network adapter and the other when you want to use the docking station's adapter.

To switch virtual Ethernet adapters in a virtual machine:

  1. Follow the usual steps to configure your Workstation virtual machine with one virtual Ethernet adapter that uses bridged networking on the VMnet0 switch. For example, perform the configuration while the PC Card adapter is in use.

  2. After you have tested the initial configuration, shut down your virtual machine and exit Workstation.

  3. Switch the setup so the other physical network adapter is being used. For example, if you first configured the computer while the PC Card adapter was in use, you should now set the computer up in the docking station so its physical network adapter is in use.

  4. Open a shell window.

  5. Change to the Workstation programs directory. If you have installed Workstation in the default location, the command is:
    cd <UserHome>/vmware/

  6. Run the following command:
    vnetconfig -s -ib vmnet2

  7. If you see a dialog box that asks which network adapter to use, choose the adapter that is currently installed (not the one you already configured for bridged networking in step 1).
  8. Start the service "VMnet Bridge (for VMnet2)". If it does not start, reboot the system and try to start it again.
  9. Change to the directory where the files for the virtual machine you are configuring are stored.
  10. Copy the .cfg file under a different name, so that you have two copies -- one to use when you are using the PC Card adapter (referred to here as pcmcia.cfg) and one to use when you are using the network adapter in the docking station (referred to here as nic.vmx).
  11. Launch Workstation, select Open Existing Virtual Machine, and open the .cfg file for the virtual adapter you will set up on VMnet2 ( nic.vmx in our example). You will probably have to browse to locate it.
  12. Open the Configuration Editor (Settings > Configuration Editor) and select Ethernet Adapter.
  13. From the drop-down list on the right, select Custom (VMnet2).
  14. Click OK to save your changes and close the Configuration Editor.
  15. When you are using the PC Card adapter, launch your virtual machine using pcmcia.cfg. When you are using the adapter in the docking station, use nic.vmx. Both configuration files will be for the same virtual machine. When you choose one, you will just be choosing which network adapter to use.

    Note: If you make a change to other aspects of one configuration, remember to make the same change to the other configuration the next time you open it.

Back to top

© 2001 VMware, Inc. All rights reserved.