test

Page 52

3 Configuring virtual machines When you first create a virtual machine, VirtualBox by default enables one virtual network card and selects the “Network Address Translation” (NAT) mode for it. This way the guest can connect to the outside world using the host’s networking and the outside world can connect to services on the guest which you choose to make visible outside of the virtual machine. This default setup is good for probably 95% of VirtualBox users. However, VirtualBox is extremely flexible in how it can virtualize networking. It supports many virtual network cards per virtual machine, the first four of which can be configured in detail in the Manager window. Additional network cards can be configured on the command line with VBoxManage. Because of the vast array of options available, we have dedicated an entire chapter of this manual to discussing networking configuration; please see chapter 6, Virtual networking, page 88.

3.9 Serial ports VirtualBox fully supports virtual serial ports in a virtual machine in an easy-to-use manner.7 Ever since the original IBM PC, personal computers have been equipped with one or two serial ports (also called COM ports by DOS and Windows). Serial ports were commonly used with modems, and some computer mice used to be connected to serial ports before USB became commonplace. While serial ports are no longer as ubiquitous as they used to be, there are still some important uses left for them. For example, serial ports can be used to set up a primitive network over a nullmodem cable, in case Ethernet is not available. Also, serial ports are indispensable for system programmers needing to do kernel debugging, since kernel debugging software usually interacts with developers over a serial port. With virtual serial ports, system programmers can do kernel debugging on a virtual machine instead of needing a real computer to connect to. If a virtual serial port is enabled, the guest operating system sees a standard 16550A compatible UART device. Both receiving and transmitting data is supported. How this virtual serial port is then connected to the host is configurable, and the details depend on your host operating system. You can use either the graphical user interface or the command-line VBoxManage tool to set up virtual serial ports. For the latter, please refer to chapter 8.7, VBoxManage modifyvm, page 116; in that section, look for the --uart and --uartmode options. In either case, you can configure up to two virtual serial ports per virtual machine. For each such device, you will need to determine 1. what kind of serial port the virtual machine should see by selecting an I/O base address and interrupt (IRQ). For these, we recommend to use the traditional values8 , which are: a) COM1: I/O base 0x3F8, IRQ 4 b) COM2: I/O base 0x2F8, IRQ 3 c) COM3: I/O base 0x3E8, IRQ 4 d) COM4: I/O base 0x2E8, IRQ 3 2. Then, you will need to determine what this virtual port should be connected to. For each virtual serial port, you have the following options: • You can elect to have the virtual serial port “disconnected”, which means that the guest will see the device, but it will behave as if no cable had been connected to it. • You can connect the virtual serial port to a physical serial port on your host. (On a Windows host, this will be a name like COM1; on Linux or Solaris hosts, it will be a device node like /dev/ttyS0). VirtualBox will then simply redirect all data received from and sent to the virtual serial port to the physical device. 7 Serial 8 See,

port support was added with VirtualBox 1.5. for example, http://en.wikipedia.org/wiki/COM_(hardware_interface).

52


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.