Proxmox under Virtualbox - no outbound networking

Jul 3, 2014
99
0
6
Toronto, Ontario, Canada
Hi,
I set up exactly per my article on https://pve.proxmox.com/wiki/Virtualbox - which describes steps to install Proxmox inside Virtualbox for a setup that can be portable in a laptop. However, clearly I have done something wrong as neither the proxmox host nor the guests can ping 8.8.8.8

I think it's an issue where I need to set up a Linux Bridge - such that traffic from these gets routed to the laptop's wifi connection, but as much as I have investigated some likely candidate guides (listed as https://pve.proxmox.com/wiki/Virtualbox#References) - I'm lacking some understanding of how Linux bridges and routing is supposed to work.

I think having a basic guide to help people get started is useful, which is why I wrote it, but presently it's wrong so I'm additionally concerned that the article might mislead people.

Could someone take a look, (optionally try it) and help fix the networking part?

Thanks kindly,
Martin.
 

Mr.Holmes

Member
Apr 5, 2014
281
3
16
Hello Martin,


I think it's an issue where I need to set up a Linux Bridge - such that traffic from these gets routed to the laptop's wifi connection, but as much as I have investigated some likely candidate guides (listed as https://pve.proxmox.com/wiki/Virtualbox#References) - I'm lacking some understanding of how Linux bridges and routing is supposed to work.

I think having a basic guide to help people get started is useful, which is why I wrote it, but presently it's wrong so I'm additionally concerned that the article might mislead people.

Note regarding vbox networking:

- wlan bridging is not reliable

- bridging in virtual Proxmox to virtual vbox network ("Host only") does not work fine, because vbox switching does not accept the MAC addresses of the virtual Proxmox NIC (veth devices)

- vbox NAT does not work in all details as specified - use NAT (and not "NAT network"!) for "Adapter 1" only

The following configuration works fine in my environment

- in physical PC (vbox host):

-- define NAT subnet explicitely by

Code:
VBoxManage modifyvm "proxmox-vm" --natnet1 "[COLOR=#b22222]192.168.11.0/24[/COLOR]"

-- "Host only" network address 192.168.4.1

-- route to CTs with

Code:
route add -net [COLOR=#0000cd]192.168.9.0/24[/COLOR] gw [COLOR=#006400]192.168.4.2[/COLOR]

or in in case of Windows

Code:
route add -p [COLOR=#0000cd]192.168.9.0[/COLOR] mask 255.255.255.0 [COLOR=#006400]192.168.4.2[/COLOR]



- vbox Proxmox virtual machine:

-- eth0 = "Adapter 1" connected with NAT - address 192.168.11.15/24, gateway 192.168.11.2, DNS 192.168.11.3

-- eth1 = "Adapter 2" connected with "Host only" - address 192.168.4.2/24

-- vmbr1 (not bridged to any NIC in virtual Proxmox host) - address 192.168.9.1/24

- each container

-- venet0 address 192.168.11.16, 17 etc.

-- veth NIC bridged to vmbr1 address 192.168.9.2,3 etc

-- route to physical PC with

Code:
route add -net [COLOR=#006400]192.168.4.0/24[/COLOR] gw [COLOR=#0000cd]192.168.9.1[/COLOR]


Now WAN is accessed from Proxmox and CTs via NAT, Proxmox to local PC and vice versa by "Host only" network, CTs too, but have an additional hop in virtual Proxmox host.


Could someone take a look, (optionally try it) and help fix the networking part?

I´ll have a closer look and make update suggestions if necessary

Kind regards

Mr.Holmes
 
Last edited:

Mr.Holmes

Member
Apr 5, 2014
281
3
16
Thanks Mr.Holmes, I would appreciate if you could.

Regards, M.

Voilà!

Since I don´t have a Wiki account I send it as attachment. I suggest to use as titel "VirtualBox" (with capital letter "B" as Oracle does).

Success!

Mr.Holmes
 

Attachments

  • vbox-update.txt
    7 KB · Views: 99
Jul 3, 2014
99
0
6
Toronto, Ontario, Canada
Ok, I just went through everything again as I concluded that not everything you'd said on this thread was as thoroughly explained on the wiki page.

I've tried to assimilate the narrative context from this thread onto the page. I'm sure it could do with some additional work, especially around testing that the CTs are accessible from the laptop.

Also, will adding further CTs require the addition of routes?
 
Jul 3, 2014
99
0
6
Toronto, Ontario, Canada
Also, http://forum.proxmox.com/threads/20...ox-no-outbound-networking?p=102211#post102211 talks about using natnet1 - I incorporated this into https://pve.proxmox.com/wiki/Virtualbox#Changing_the_Default_Network ... that implies we need the DHCP server on. However https://www.virtualbox.org/manual/ch06.html#network_nat_service implies it is not on by default.

But now I am concerned that I've introduced a natnet that you may have meant to no longer keep in your instructions.

I did test to see if there was a nat network running using:
````
VBoxManage list natnetworks
````
But the result returned implied that there is not.
 
Jul 3, 2014
99
0
6
Toronto, Ontario, Canada
Implementation in proxmox-in-virtualbox github project

Ok - in an attempt to get clarity and repeatability, and rather than build out a wiki article, I've incorporated your instructions into https://github.com/mrjcleaver/proxmox-in-virtualbox/blob/master/make-proxmox.rb#L35

I would appreciate if you would lend a few minutes to guide me, particularly in the implementation here:

Code:
[FONT=lucida console]
[/FONT]define_vbox_subnet_for_nat([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])

[COLOR=#808080][I]#nat_net_cidr_cidr ** Adapter 1: NAT (attention: [/I][/COLOR][COLOR=#808080][B][I]'''NOT''' [/I][/B][/COLOR][COLOR=#808080][I]NAT-network!!)
[/I][/COLOR]connect_vbox_adapter([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#0000ff]1[/COLOR], [COLOR=#008000][B]'nat'[/B][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])


[COLOR=#808080][I]#** Adapter 2: Host-only Adapter, vboxnet0; recommended leave the advanced settings as they are.
[/I][/COLOR]make_vbox_host_only_network(name, [COLOR=#660e7a][B]@hostonly_network_ip[/B][/COLOR])
connect_to_hostonly([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@hostonly_network_ip[/B][/COLOR])


route_host_to_containers([COLOR=#660e7a][B]@container_network_cidr[/B][/COLOR], [COLOR=#660e7a][B]@hostonly_gateway[/B][/COLOR])

[COLOR=#808080][I]# proxmox in vbox setup
[/I][/COLOR][COLOR=#808080][I]# [/I][/COLOR][COLOR=#808080][B][I][URL]http://forum.proxmox.com/threads/20054-Proxmox-under-Virtualbox-no-outbound-networking[/URL]
[/I][/B][/COLOR][COLOR=#808080][I]#- vbox Proxmox virtual machine:
[/I][/COLOR][COLOR=#808080][I]#-- eth0 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 1" [/I][/B][/COLOR][COLOR=#808080][I]connected with NAT - address 192.168.11.15/24, gateway 192.168.11.2, DNS 192.168.11.3
[/I][/COLOR][COLOR=#808080][I]#-- eth1 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 2" [/I][/B][/COLOR][COLOR=#808080][I]connected with [/I][/COLOR][COLOR=#808080][B][I]"Host only" [/I][/B][/COLOR][COLOR=#808080][I]- address 192.168.4.2/24
[/I][/COLOR][COLOR=#808080][I]#-- vmbr1 (not bridged to any NIC in virtual Proxmox host) - address 192.168.9.1/24
[/I][/COLOR][COLOR=#003c5a][I]nat_net_proxmox_ip [/I][/COLOR]= [COLOR=#008000][B]'192.168.11.15'  [/B][/COLOR][COLOR=#808080][I]# not a global variable because in cluster we'd need a ip for each proxmox node
[/I][/COLOR][COLOR=#003c5a][I]nat_net_subnet_mask [/I][/COLOR]= [COLOR=#008000][B]'255.255.255.0'
[/B][/COLOR][COLOR=#808080][I]#-- eth0 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 1" [/I][/B][/COLOR][COLOR=#808080][I]connected with NAT - address nat_net_proxmox_ip, gateway [/I][/COLOR][COLOR=#808080][B][I]@nat_net_gateway[/I][/B][/COLOR][COLOR=#808080][I], DNS [/I][/COLOR][COLOR=#808080][B][I]@nat_net_dns
[/I][/B][/COLOR][COLOR=#808080][I]#-- eth1 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 2" [/I][/B][/COLOR][COLOR=#808080][I]connected with [/I][/COLOR][COLOR=#808080][B][I]"Host only" [/I][/B][/COLOR][COLOR=#808080][I]- address [/I][/COLOR][COLOR=#808080][B][I]@hostonly_gateway
[/I][/B][/COLOR][COLOR=#808080][I]#-- vmbr1 (not bridged to any NIC in virtual Proxmox host) - address 192.168.9.1/24
[/I][/COLOR]proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth0 -type eth -address [/B][/COLOR]#{[COLOR=#003c5a][I]nat_net_proxmox_ip[/I][/COLOR]}[COLOR=#008000][B] -netmask [/B][/COLOR]#{[COLOR=#003c5a][I]nat_net_subnet_mask[/I][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])
proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth0 -gateway [/B][/COLOR]#{[COLOR=#660e7a][B]@nat_net_gateway[/B][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])

proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth1 -gateway [/B][/COLOR]#{[COLOR=#660e7a][B]@hostonly_gateway[/B][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])
proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/vmbr0 -address [/B][/COLOR]#{[COLOR=#660e7a][B]@container_network_vmbr_ip[/B][/COLOR]}[COLOR=#008000][B] -comments 'container network'"[/B][/COLOR])

connect_to_private_network([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])

Thanks, as ever.
Martin.
 

JoKr

Member
Jan 18, 2017
2
0
6
37
Hi,

is there anyone who ever managed to run PVE in VirtualBox with Outbound and Inbound traffic for the PVE guests?

Please share your PVE /etc/network/interfaces file of PVE and one guest.

Setup:
Win10 Host -> VirtualBox -> PVE -> Debian

BR
Jo
 

Coffeebean

Member
Sep 26, 2019
3
0
6
52
Hi


I have the same problem trying to get PVE in/out bound communication to work with PVE v6.0-4. I have the same setup as JoKr:
Win10 Host -> VIrtualBox -> PVE 6.0-4

I tried using the above wiki instructions but could not access internet via host-only/Nat setting in VBox for the Proxmox host. Not sure what I was doing wrong with that but I need the Proxmox cluster to access other computers on the network.

So I tried bridge which almost works where Proxmox can access any computer on my network as well as the internet however, the VM s (in Proxmox) cannot ping computers on local network nor internet. VMs also cannot ping Proxmox host (as vise versa)

Any help would be greatly appreciated. Thanks in advance.

Some screen shots attached.
 

Attachments

  • proxmox-network.PNG
    proxmox-network.PNG
    56.7 KB · Views: 35
  • virtualbox-network.PNG
    virtualbox-network.PNG
    83.1 KB · Views: 36

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!