How-To: Create a NethServer instance in VirtualBox machine

@Ctek thank for the howto, well detailed…nice

I missed the point why you take the way to install NS on two NIC with an internal network and a bridged network. This is needed when you want to test a gateway configuration and you learned me that the internal network can be pinged from the real computer (I didn’t know before, I used another VM for that), but if you want to be simple you could take the choice to install NS only on one bridged NIC and use it to be a real host on your network (give an IP in your range, the gateway of your network…)

I can follow the ‘full’ installation. One of NS strong points is the Gateway/UTM. By installing both red and green interface the Gateway/UTM installation is also documented. For documentation sake this is a good initiative.

Hi Stephane,
As Rob has said, my goal was to present the “full setup” In Gateway/Router mode.
This way the user can test all the options of a real NS installation and not only server mode.

Plus, now it will be simple to add more VBox clients that are connected to vboxnet0 and this way you create your own virtual lan with machines behind NS that will provide them with access to internet. (you can now do what you do with VmWare virtual switches :slight_smile: ).

I hope this will help some new user.
it will also be linked with the Dev how-to because it was one of the requirements to be able to play with NS in a virtual environment

PS: If anyone has followed this How-to please give us your feedback

I have an issue on a debian host with virtualbox5, In fact when I set the vboxnet1 to an IP of my network, the IP is reachable but it goes to the host and not to the VM…I need to dig a bit

here the ifconfig on my host which runs virtualbox…fun

# ssh root@192.168.xx50
The authenticity of host '192.168.xx.50 (192.168.xx.50)' can't be established.
RSA key fingerprint is 5f:7b:d0:2f:88:cf:c0:76:9b:6a:0e:c7:c1:b7:2f:2b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.xx.50' (RSA) to the list of known hosts.
root@192.168.xx.50's password: 
Linux htpc-server 3.2.0-4-amd64 #1 SMP Debian 3.2.71-1 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 16 16:01:02 2015 from leo.lan
root@htpc-server:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 94:de:80:bf:d6:56  
          inet adr:192.168.xx.100  Bcast:192.168.xx.255  Masque:255.255.255.0
          adr inet6: fe80::96de:80ff:febf:d656/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2687901 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3342484 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:744051082 (709.5 MiB)  TX bytes:1629300672 (1.5 GiB)
          Interruption:74 Adresse de base:0xc000 

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3331679 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3331679 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          RX bytes:41995499667 (39.1 GiB)  TX bytes:41995499667 (39.1 GiB)

vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00  
          inet adr:192.168.56.1  Bcast:192.168.56.255  Masque:255.255.255.0
          adr inet6: fe80::800:27ff:fe00:0/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:724 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:0 (0.0 B)  TX bytes:83131 (81.1 KiB)

vboxnet1  Link encap:Ethernet  HWaddr 0a:00:27:00:00:01  
          inet adr:192.168.xx.50  Bcast:192.168.xx.255  Masque:255.255.255.0
          adr inet6: fe80::800:27ff:fe00:1/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1122 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:0 (0.0 B)  TX bytes:106412 (103.9 KiB)

root@htpc-server:~#

Hi Stephane.
Maybe i did not understand exactly what you want to acheive. But from what i understood this should apply

The vboxnetX is an internal only network (that means that it is only between the virtual box machines and the host PC)

When you set an IP to vboxnetX from the preferences of Virtual Box, you are setting that IP for the Host PC to be able to reach the virtual network.

If you want the vboxnetX to reach the outside (physical lan) you must bridge it somehow.

BR
Bogdan

My 2c, I have had zero issues with quite a number of vms using dynamically allocated space, even on vms that have a lot of io, and it saves a lot of hd.

1 Like

Hi Fasttech, thanx for your input.
You are right but i wanted to keep it simple for new users.
But now you just give me an idea to present an alternative step instead of fixed size to use dynamic.
This also means that i’ll have to explain to te users about the differences and the way it functions.

Ps most of the time i did not have any issue with dynamic option but some distros had some problems back in the day.

Thanx for your feedback. Rally apreciate all input.

Br
Bogdan

1 Like

This is one of the vms on one of the hosts at a client, that’s a pretty telling difference in allocation and actual use.

1 Like

The real trap when using Dynamic allocation is that, if you have a lot of machines and you keep adding more files to the storage where the hdd images are stored you can end up in the scenario where there is no more space and the machines freeze because they can’t expand the HDD image because there is no more.

For example I keep a rule like this:

Storage space needed = (Number of VM’s x ~60GB dynamic HDD) + (Number of VM’s x 8 GB free space minimum )

So for 14 VM’s i need space (14 x 60) + (14 x 8) = ~950GB

You will have to think and plan carefully.
But i think this is not the case with local vboxes :smile:

BR
Bogdan

2 Likes

Well, there’s no question you’re responsible for knowing what space you have available.

What’s really fun, is the real power of a vm… snapshots. :slight_smile:

That particular vm currently has 21 Gb of snapshots. O_o lol!

I’ve already added the Alternative step to configure the storage for Vbox.

Thanx again for the feedback :smile:

BR
Bogdan

2 Likes

Stunning! :open_mouth:

I’ve been following this installation on a Windows 10 host. Everything is the same, except the names of the network adapters during setup. I’m using 192.168.1.50 instead of 192.168.1.1, because my cable modem uses that address. Everything works until I get to the part where I am running Nethserver web-admin interface in a browser and change the role of eth0 to Internet (red). From that point on, I can no longer access the web interface or even ping the virtual server from the host. Any ideas?

That’s normal behaviour! As soon you activate an interface as external/red the firewall rules kick in. If you need to access the server from another IP address (either on you LAN or external) you need to create some holes in the firewall (=open ports) Especially the admin page is not available from the outside, for good reasons!.

This was a battle to get NethServer Running. I believe I made success and want to share my findings with those who have had the same problem. First Bogdan’s document is helpful although I could not get NethServer to work in a complete sense. Until now that is.


From NethServer I cannot ping .20,.25,.65,.254

From local machine I cannot ping .25

But I can ping .20,.65,.254 (of course)

From NethServer I cannot ping .25 (it’s self)
Why is that?

With the above situation I would be unable to access the web interface.


To resolve this situation I have suggested:

  1. Remove the Host Only Adapter

  2. Re add the Adapter

  3. Open the Web App

  4. Don’t use DHCP and try Static


But is there another way to do this with out removing the adapter? I keep going in circles doing this other times.


Better way?

  1. Change the “Host Only Adapter” to “Internal Network”
  2. Shutdown the NethServer
  3. Change the “Internal Network” back to “Host Only Adapter”
  4. Restart NethServer
  5. Log into the Web App
  6. Change the DHCP and try the Static. Use the same Host-Only settings found on the Local Machine “Host-Only Adapter” (IP & Netmask). Change the Gateway to that of the Local Machine “Default Gateway” discovered with the ipconfig command.

THIS WORKED!


IMPORTANT NOTES (Concerning this configuration)

On the Local Computer where Virtual box is hosted is a DHCP internet machine. In other words the settings can change.


The Local IP Address: 192.168.1.???
Default Gateway: 192.168.1.???

Mine has not changed for quite some time. Maybe if I reset the Router they may change. If so, the last three digits of the Default Gateway will have to be reinputed into the NethServer settings.


Ping Tests

Local Machine:
192.168.1.20 (worked)
192.168.1.25 (worked)
192.168.1.65 (worked)
192.168.1.254 (worked)

NethServer:
192.168.1.20 (worked)
192.168.1.25 (worked)
192.168.1.65 (worked)
192.168.1.254 (worked)

Conclusion:

My intention is use this NethServer as a test unit only. I need to figure the best way to use as VM first with VirtualBox (Home) and then with VMware (Work).
I had to be sure that I could:

  1. Get access to the Web App.
  2. Get access to the internet via the Web App.
  3. Users will be able to access the services offered & vice versa.

I am now that much more confident with NethServer!

4 Likes

Hi Ted,
Thank you for your feedback and info.
From what I’ve seen, you are switching the settings of the type for adapter as a mean to “reset” them.

This made me wander what are your normal network environment settings ?
Are you using a router to allocate DHCP with reserved IP settings for your LAN machines ?
Or are you using a direct connection between your modem/router and your PC (this can explain why the ip changes)?

As you noticed I’ve mentioned in the post to make the users aware

NOTE: This settings depend on your network environment!

If your physical LAN to which the Host PC is connected, gets the IP’s via DHCP, then the Vbox machine eth0 adapter, will also obtain the IP from your DHCP server.

Otherwise, if your physical LAN uses manually specified IP address for your machines, you will have to keep the Static option checked, and enter the values that you want.
Those values should be in the same range as the ones for your Host PC but NOT identical!

But it can also be a issue with virtual box.
What OS and Vbox are you using ?

I’m intrigued by the impossibility to ping those specific ip’s you mentioned and NS itself.

PS: VMware or Proxmox cand be better suited as platforms.

Best regards
Bogdan

1 Like

Great to hear this :smiley_cat:

@MillerT, I encountered the same problems with VirtualBox. I investigated a bit, I think it’s a limitation of the CentOS network startup scripts when dealing with DHCP.
I “fix” the problem with two simple commands:
db networks setprop enp0s8 role green ipaddr 192.168.56.71 netmask 255.255.255.0
signal-event interface-update
where enp0s8 is the host only adapter.

3 Likes

Hi Filipp0,

Thank you for the input, If I run into a problem with this (on my newer
test unit I may call on you.)

Ted Miller

C: 203-278-4606

H: 203-634-7624