beautypg.com

Sun Microsystems VIRTUALBOX VERSION 3.1.0_BETA2 User Manual

Page 134

background image

8 VBoxManage reference

• If you use internal networking for a virtual network adapter of a virtual ma-

chine, use VBoxManage dhcpserver add --netname ,
where is the same network name you used with
VBoxManage modifyvm --intnet

.

• If you use host-only networking for a virtual network adapter of a virtual ma-

chine, use VBoxManage dhcpserver add --ifname
instead, where is the same host-only interface name
you used with VBoxManage modifyvm --hostonlyadapter

.

Alternatively, you can also use the –netname option as with internal net-
works if you know the host-only network’s name; you can see the names with
VBoxManage list hostonlyifs

(see chapter

8.1

,

VBoxManage list

, page

111

above).

The following additional parameters are required when first adding a DHCP server:

• With --ip, specify the IP address of the DHCP server itself.

• With --netmask, specify the netmask of the network.

• With --lowerip and --upperip, you can specify the lowest and highest IP

address, respectively, that the DHCP server will hand out to clients.

Finally, you must specify --enable or the the DHCP server will be created in the

disabled state, doing nothing.

After this, VirtualBox will automatically start the DHCP server for given internal

or host-only network as soon as the first virtual machine which uses that network is
started.

Reversely, use VBoxManage dhcpserver remove with the given --netname

or --ifname to remove the DHCP

server again for the given internal or host-only network.

To modify the settings of a DHCP server created earlier with VBoxManage

dhcpserver add

, you can use VBoxManage dhcpserver modify for a given

network or host-only interface name.

134