VM to connect Internet via Host
Hi all
Host Debian 7.3 VM Ubuntu 12.04 Oracle VirtualBox Cable connection of Host ISP -> PC Static IP address 2 NICs Host can access Internet /etc/network/interfaces Code:
# The loopback network interface Code:
nameserver xxx.xxx.xxx.xxx Please advice how to make VM connect Intenet via Host? Would following document relevant? VirtualBox: Make your virtual machine accessible from your host system but not from the local network http://slopjong.de/2013/05/14/virtua...local-network/ Thanks Rgds satimis |
VirtualBox allows 6 different kinds of VM NICs:
See the VirtualBox documentation/help file for more information. |
Quote:
What I expect to achieve is without router would it be possible to assign static IP to the VM? So that the VM can be browsed on Internet satimis |
Quote:
If you choose NAT, your guest will get an address from Virtualbox via DHCP. This is why you have to set eth0 to DHCP in /etc/interfaces on the guest (assuming eth0 is the device connected to the NAT network). If you need the same address each time you boot the guest, you should be able to configure VirtualBox and/or dnsmasq, the program that implements the DHCP server. I can't help with that, but VirtualBox documentation is pretty good. |
Quote:
I'll make some search on VirtualBox document. Do you have any idea under which heading? Thanks satimis |
Quote:
|
Quote:
|
Quote:
Thanks for your advice. I did that before behind a router. But now there is no router I could not figure out how set Br0 on both Host and VM (a webserver). I want VM assigned a static IP so that it can be browsed on Internet. Here below is my suggestion: Host Code:
# The loopback network interface Code:
# The loopback network interface Rgds satimis |
Why are you creating bridges on the hypervisor and the VM?
|
Quote:
Any mistake made on /etc/network/interface of Host ? Thanks satimis |
I think there may have been a slight misunderstanding here. When I recommended using a "bridged interface", I was refering to the NIC setup for the VM in VirtualBox, not the configuration of the hypervisor or the VM OS.
If you're using the Oracle GUI to manage your virtual machines, you'll find the relevant setting under "Network". For each NIC on that tab, in the pulldown menu next to the text "Attached to:" you'll find the various operatin modes I mentioned earlier. That's where you'll need to select "Bridged adapter" for the VM NIC to appear on the same network as one of the physical adapters on the hypervisor. Once you've done this, configure eth0 on the VM with a static IP address as you would any other host on that network. |
In case you still want to use NAT, set the IP address according to instructions "9.11. Fine-tuning the VirtualBox NAT engine" in the VirtualBox help file.
|
Quote:
Performed following steps Host /etc/network/interfaces Code:
# The loopback network interface -> network Adapter 1 Attached to: Bridged Adapter Name eth0/br0/eth1 None of them can work, unable to access Internet. B.R. satimis |
Quote:
Thanks for your advice. I have to face 2 problems on using NAT 1) Can I do port forwarding? 2) On running FileZilla download folders/files the VM aborted automatically log Code:
.... Rgds satimis |
All times are GMT -5. The time now is 10:00 PM. |