How can I configure a DHCP server assigned to a Host-only net in virtualbox

13

I can create an adapter via VBoxManage hostonlyif create but how to I configure it with DHCP, it doesn't seem like VBoxManage hostonlyif ipconfig take any arguments for DHCP:

Kits-MacBook-Air:media-pop kitsunde$ VBoxManage hostonlyif ipconfig vboxnet0
Oracle VM VirtualBox Command Line Management Interface Version 4.1.16
(C) 2005-2012 Oracle Corporation
All rights reserved.

Usage:

VBoxManage hostonlyif       ipconfig <name>
                            [--dhcp |
                            --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |
                            --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]
                            create |
                            remove <name>


Syntax error: Not enough parameters
Kits-MacBook-Air:media-pop kitsunde$ VBoxManage hostonlyif ipconfig vboxnet0 --dhcp
VBoxManage: error: Code NS_ERROR_NOT_IMPLEMENTED (0x80004001) - Not implemented (extended info not available)
Context: "EnableDynamicIpConfig ()" at line 244 of file VBoxManageHostonly.cpp
virtualbox
asked on Super User May 27, 2012 by Kit Sunde

1 Answer

26

Seems like I can do this:

VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1
VBoxManage dhcpserver add --ifname vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.100 --upperip 192.168.56.200
VBoxManage dhcpserver modify --ifname vboxnet0 --enable
answered on Super User May 27, 2012 by Kit Sunde • edited Jan 18, 2013 by Der Hochstapler

User contributions licensed under CC BY-SA 3.0