Create a DHCP server and network within VirtualBox

Discussions related to using VirtualBox on Linux hosts.

Create a DHCP server and network within VirtualBox

Postby webmanoffesto » 10. Jan 2018, 19:30

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   Expand viewCollapse view
/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?
webmanoffesto
 
Posts: 3
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

Postby socratis » 10. Jan 2018, 19:53

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...
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25232
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Create a DHCP server and network within VirtualBox

Postby webmanoffesto » 11. Jan 2018, 16:53

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   Expand viewCollapse view
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
webmanoffesto
 
Posts: 3
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

Postby socratis » 11. Jan 2018, 17:02

1) Good.
2) Yes.

PS. Nit-pick; you're on a Linux host, CaPiTaLiZaTiOn matters. It's "VBoxManage"... ;)
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25232
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Create a DHCP server and network within VirtualBox

Postby Perryg » 11. Jan 2018, 17:32

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 ).
Perryg
Site Moderator
 
Posts: 34373
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

Postby socratis » 11. Jan 2018, 18:45

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
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25232
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Create a DHCP server and network within VirtualBox

Postby Perryg » 11. Jan 2018, 18:49

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 ).
Perryg
Site Moderator
 
Posts: 34373
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

Postby socratis » 11. Jan 2018, 18:55

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
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25232
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Create a DHCP server and network within VirtualBox

Postby Perryg » 11. Jan 2018, 19:05

Sorry auto-correct changed what I meant. It should have said muscle memory. The other is a water creature.
Perryg
Site Moderator
 
Posts: 34373
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

Postby umer203 » 12. Aug 2019, 03:19

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
umer203
 
Posts: 1
Joined: 12. Aug 2019, 02:48

Re: Create a DHCP server and network within VirtualBox

Postby MontyMan » 13. Aug 2019, 15:05

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.
MontyMan
 
Posts: 29
Joined: 30. Jan 2019, 22:08
Location: Houston, Texas USA
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows 10, Windows XP SP3, Haiku


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 22 guests