Create a DHCP server and network within VirtualBox

Discussions related to using VirtualBox on Linux hosts.
Post Reply
webmanoffesto
Posts: 10
Joined: 29. Dec 2011, 18:19
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Windows XP

Create a DHCP server and network within VirtualBox

Post by webmanoffesto »

I'm on Ubuntu Gnome 16. I'm trying to follow the instructions at
Kali Linux Virtualbox Pentest Lab
https://www.hackingloops.com/kali-linux ... ntest-lab/
But I'm having trouble creating the DHCP server and network,

As far as I can tell, VirtualBox is installed in /usr/lib/virtualbox
[Mod edit: removed unecessary output of 'sudo ls -lR | grep "VirtualBox"', there no need for that]

But the below command seems to fail.

Code: Select all

/usr/lib/virtualbox$ vboxmanage dhcpserver add –netname mydhcpnetwork –ip 10.10.10.1 –netmask 255.255.255.0 –lowerip 10.10.10.2 –upperip 10.10.10.10 –enable
Oracle VM VirtualBox Command Line Management Interface Version 5.0.40_Ubuntu
(C) 2005-2017 Oracle Corporation
All rights reserved.

Usage:

VBoxManage dhcpserver       add|modify --netname <network_name> |
                                       --ifname <hostonly_if_name>
                            [--ip <ip_address>
                            --netmask <network_mask>
                            --lowerip <lower_ip>
                            --upperip <upper_ip>]
                            [--enable | --disable]

VBoxManage dhcpserver       remove --netname <network_name> |
                                   --ifname <hostonly_if_name>
How do I fix this problem?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Create a DHCP server and network within VirtualBox

Post by socratis »

How about paying attention to the number of dashes before the switches? It's not "-", it's "--", it says so in the help... ;)

Oh, BTW if you need help from these forums, you'd better get rid of the "5.0.40_Ubuntu" version and install the official one from the VirtualBox website...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
webmanoffesto
Posts: 10
Joined: 29. Dec 2011, 18:19
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Create a DHCP server and network within VirtualBox

Post by webmanoffesto »

socratis wrote:Oh, BTW if you need help from these forums, you'd better get rid of the "5.0.40_Ubuntu" version and install the official one from the VirtualBox website...
Okay, done.
socratis wrote:How about paying attention to the number of dashes before the switches? It's not "-", it's "--", it says so in the help... ;)
Which items count as switches?
Would it be?

Code: Select all

vboxmanage dhcpserver add --netname mydhcpnetwork --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.10 --enable
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Create a DHCP server and network within VirtualBox

Post by socratis »

1) Good.
2) Yes.

PS. Nit-pick; you're on a Linux host, CaPiTaLiZaTiOn matters. It's "VBoxManage"... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Create a DHCP server and network within VirtualBox

Post by Perryg »

PS. Nit-pick; you're on a Linux host, CaPiTaLiZaTiOn matters. It's "VBoxManage"... ;)
Slight correction: While it is true that Linux is case sensitive VBox DEVs did create an "ln" between VBoxManage and vboxmanage some time ago because so many new to Linux users were failing ( think Windows users because windows is not really case sensitive ).
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Create a DHCP server and network within VirtualBox

Post by socratis »

Perryg wrote:VBox DEVs did create an "ln" between VBoxManage and vboxmanage
Really? :shock:
Hmm, they didn't do that for OSX users/installations. The only "vbox*" I have is "vbox-img" and "vboxwebsrv".
Thanks Perryg, I stand CoRrEcTeD! :D
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Create a DHCP server and network within VirtualBox

Post by Perryg »

I really can't speak for OSx ( don't have it ) I really don't remember exactly when it was changed for Linux but saw other user that were using the all lower case and it worked so I tried it and for sure it worked. I still use the case way because it has become kind of muscle memory or brain memory ( which ever floats your boat ).
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Create a DHCP server and network within VirtualBox

Post by socratis »

Perryg wrote:it has become kind of mussel memory or brain memory ( which ever floats your boat ).
I searched for "mussel memory" and I couldn't find anything close to what I believe you might mean, but it will definitely float my boat! :D
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Create a DHCP server and network within VirtualBox

Post by Perryg »

Sorry auto-correct changed what I meant. It should have said muscle memory. The other is a water creature.
umer203
Posts: 1
Joined: 12. Aug 2019, 02:48

Re: Create a DHCP server and network within VirtualBox

Post by umer203 »

socratis

I need your kind help i am encountering following issue?
root@kali:~# vboxmanage dhcpserver add --netname NatNetwork --ip 10.10.10.1 --netmask 255.255.255.0 lowerip 10.10.10.2 --upperip 10.10.10.12 --enable
bash: vboxmanage: command not found

root@kali:~# vboxmanage dhcpserver add --netname test-Network --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable
bash: vboxmanage: command not found


Kind Regards
MontyMan
Posts: 29
Joined: 30. Jan 2019, 22:08
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows 10, Windows XP SP3, Haiku
Location: Houston, Texas USA

Re: Create a DHCP server and network within VirtualBox

Post by MontyMan »

Dear Umer,

I'm not @socratis but from your post I don't think you have VBoxManage installed properly. Neither in this chapter on VBoxManage... https://www.virtualbox.org/manual/ch08.html ... nor in the installation chapter does it mention the need to install VBoxManage separately; I think when you go into your package manager and install VirtualBox then you get the command line version at the same time; this should prevent the unknown command error you saw.

Based on some hosts having the logical link back to the familiar all-lower-case program name and some not having it, you might try the command again as VBoxManage....

HTH
.Monty.
Post Reply