I am running Ubuntu Server 10.04 on a VirtualBox virtual machine from a Windows 7 host.
How do I open access to this guest virtual machine from the internet?
servervirtualboxvirtualization
I am running Ubuntu Server 10.04 on a VirtualBox virtual machine from a Windows 7 host.
How do I open access to this guest virtual machine from the internet?
Starting from version 4.0 we are able to limit Virtual Box bandwith for acess to disk images (see Virtual Box Manual for details)
We need to create a bandwith group first (in the example below named "Limit" for 20 MB/s):
VBoxManage bandwidthctl "VM name" add Limit --type disk --limit 20M
VBoxManage storageattach "VM name" --storagectl "SATA" --port 0 --device 0 --type hdd
--medium disk1.vdi --bandwidthgroup Limit
VBoxManage storageattach "VM name" --storagectl "SATA" --port 1 --device 0 --type hdd
--medium disk2.vdi --bandwidthgroup Limit
If you get this error:
VBoxManage: error: Cannot register the hard disk '.../foo.vdi' {...} because a hard disk '.../foo.vdi' with UUID {...} already exists
then replace the path to the disk image with the UUID given in the error (both should be the same) including the {}
To further limit disk access to 10 MB/s we can then issue
VBoxManage bandwidthctl "VM name" set Limit --limit 10M
This can even be done during runtime.
NAT is not an option for Adapter Type. Rather, it's an option for Attached to.
Click where it currently says Bridged Adapter and you should be able to select NAT.
By the way, the reason changing it to NAT sometimes helps is not specific to Windows guests. Rather, if your physical (host) PC is on a LAN, Bridged Adapter (as well as NAT) usually works fine. If your physical PC has a network connection for just one computer--as is often the case if it's plugged directly into a cable/DSL/ISDN modem that only has one Ethernet port on it--then there is no local network to bridge to, so then you must use NAT.
If you use Bridged Adapter and your host machine is on a physical LAN, your guest machine will automatically be able to see and be seen by computers on the LAN. If you use NAT on a LAN, the guest machine will be able to see the other computers on the LAN but the other computers on the LAN (besides the virtualization host) will not be able to see it.
If you're interested in more details, see these articles on network bridging and network address translation.
If that works, great. Otherwise...
In the virtual machine, open the Network Connections configuration (from the Control Panel or in Start Menu > Settings). Unless you've manually configured multiple interfaces for the guest machines in VirtualBox (or have actual network adapters attached to it with USB forwarding), you'll see just one, and unless you've changed its name, it will be called Local Area Connection (perhaps with a number after it).
Right-click on that and click Properties.
Under The connection uses the following items, click Internet Protocol (TCP/IP) and click Properties.
Make sure the configuration is correct.
If you kept the VM's network adapter bridged in VirtualBox, rather than switching it to NAT, then it is as if there is a layer 2 network switch connecting three devices:
So, your VM is "networkologically" equivalent to your host machine. Whatever settings it has (except its IP address of course), your virtual machine should have.
If you selected NAT for Attached to in VirtualBox, then it's like your real computer is acting like a small home/office router. Your host machine runs a DHCP server that is accessible only to VirtualBox virtual machines, and the guest gets all its network configuration information from it.
The VirtualBox DHCP server will provide both an IP address and DNS information to the guest, so both of these two options should be selected:
This is the particular problem, for the system in this question. If this is the only problem with the configuration, then fixing this should solve the matter entirely.
You have manual settings, rather than DHCP.
That can work, but the manual settings would need to be correct, and you'd also want to make sure the IP was not in the range of IP addresses that your router assigns from (or there could be a collision with another device on the network).
In this case, the manual settings are not correct at all, because:
The host machine's IP address on the network interface through which it provides an Internet connection to the guest is not the same as its IP address on the physical network. Even if your computer's IP address is 192.168.1.1 "in real life," the guest cannot access it that way.
But the guest cannot directly access the physical NAT router on your desk (or wherever), because any data transmitted between the VM and the real router must go through the VM's router, and the VM's router is your computer (accessed through that special virtual network interface).
Since the default gateway is wrong, no routing occurs and the VM cannot access any physical network devices outside your computer.
Since the VM's IP address is outside the correct range (which is usually 10.2.2.*) and the subnet mask is 255.255.255.0, it cannot access the correct range. (The subnet mask is correct, but together with the IP it identifies the wrong subnet.)
The DNS server must also be fixed or no hosts can be accessed through their domain names (like askubuntu.com).
If for some reason you need to use a "static IP," i.e., not use DHCP, then you'll have to get the correct information from VirtualBox and input it. Please let me know if you need help with that (I can expand this to include instructions).
Assuming DHCP is okay with you, you can solve the problem by making your Internet Protocol (TCP/IP Properties), General tab settings look like the screenshot above.
It may help to gather some more information from the guest side. In the virtualized Windows XP system that is mysteriously not connecting to the Internet, install the VirtualBox guest additions (by clicking Devices > Install Guest Additions; see the manual for more information). Reboot, and see if you can connect to the Internet. If you cannot, you've still accomplished something useful, because now you can copy and paste between the guest and host clipboards.
So open the Command Prompt in Windows. One way to do that is to run:
Start > Run... >
cmd.exe
Now run this command to get information about the Windows guest system's network interfaces and connections.
ipconfig /all
Then copy all the text in the command prompt to the clipboard. This functionality is accessible in the contextual menu raised by right-clicking anywhere inside the command prompt window. You can then edit your question on your Ubuntu host system where you have a working Internet connection, and paste it in.
More generally, for people other than the asker of this question:
You can then paste it into applications in your Ubuntu host system, permitting you to refer to it when your Windows VM is suspended/off. You can provide it to whoever is trying to help you. You can include it in your own question here on Ask Ubuntu
(However, if your network problem is in the virtual installation, rather than the virtual hardware or the VirtualBox software--for example, if your VM accessed the Internet fine until you installed some Windows software other than the guest additions--then your problem would likely be considered off- topic for Ask Ubuntu. It would likely be on-topic for Super User though.)
Best Answer
U can access your vm anywhere by " D D N S " link (what it does give u static link and make your dynamic ip auto updated through DDNS link )
Example link would like this xxx.no-ip.org
register www.no-ip.com
now u need to DMZ to the ip of vm
NOW OPEN VIRTUAL BOX > CLICK ON VM > SETTINGS > NETWORK
NOW USE STATIC IP AS I HAVE DMZ TO IP 192.168.0.200 SO MY VM IP SHOULD BE 192.168.0.200
There are Lots Of DDNS Services , But U Need To Check Which One Your Router Support By DDNS > Service Provider