Connecting to Ubuntu virtual machine remotely via internet

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Joejen
Posts: 3
Joined: 17. Apr 2015, 15:50

Connecting to Ubuntu virtual machine remotely via internet

Post by Joejen »

Dear friends,

I have recently installed VirtualBox 4.3.26 on my machine. The host configuration is Windows 8.1 running on 64-bit. I have also set up a virtual machine with Ubuntu 14 Desktop configuration. I would like to access this Ubuntu virtual machine from any other computer over the internet.

I found a tutorial on a related topic in the forums but this was related to accessing virtual machines on a LAN. However, I would like to access the virtual machine from any other computer via the internet. I currently use my Android 3G phone for accessing the internet and occasionally use a Huawei USB dongle for internet connection.

I would appreciate some guidance on this.
Thanks!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to Ubuntu virtual machine remotely via intern

Post by scottgus1 »

Use "Bridged" as your network connection style in the Virtualbox network settings for the guest. Then your router will see your Ubuntu guest as if it is just another computer on your network. Then set you guest to have a fixed IP address, and open the correct ports in your router to provide the desired services to the guest's IP address.

If the usb network device you sometimes use is a wi-fi device, you should be aware that some wi-fi adapters don't play well with Bridged networking - depends on the drivers provided by the manufacturer. Only way to find out if it will work is to test. If the device is a wifi adapter and you find that Bridged does not work with it, you can use the Virtualbox USB filters to attach the wi-fi directly to your guest (which means your host won't be able to use it while the guest has it). Either way, the fixed-IP-address-ports-opened-in-router thing is the way to let your guest be seen by the Web.
Joejen
Posts: 3
Joined: 17. Apr 2015, 15:50

Re: Connecting to Ubuntu virtual machine remotely via intern

Post by Joejen »

Thank you very much for your reply, scottgus1 :)

I am sorry but I do not have a router to access the internet. Could you kindly let me know how to enable the "fixed-IP-address-ports-opened-in-router" with my USB device to let my Ubuntu virtual machine to be accessible from any other computer on the internet? Thanks!

PS: The USB device is not a wi-fi device.

Regards.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to Ubuntu virtual machine remotely via intern

Post by scottgus1 »

OK, I think I'm beginning to get it now...
I do not have a router to access the internet
I currently use my Android 3G phone for accessing the internet and occasionally use a Huawei USB dongle for internet connection.
So this "Huawei USB dongle" connects your PC to the Android phone, and the phone feeds the internet to the PC? Tethering, I think it's called? I have not ever tried anything like this - my phone is a dumb phone, it only makes phone calls... :lol:

If I have figured this out correctly, I'm going to guess that either the android phone or the dongle is acting as a router to hand out an IP address to your PC. If you set your Virtualbox guest's "Attached To:" dropwdown to Bridged while your usb dongle is plugged in and operating correctly, does the usb dongle show up in the "Name:" dropdown underneath the "Attached To:" dropdown? If so, select it, and the guest should now be added to the usb dongle/Android network. After that, you would set the Ubuntu guest to have a static IP address in the IP range handed out by the tether, and then port-forward whatever services you need to get at in the guest from the internet. You'll have to consult Ubuntu's and Android's and the USB dongle's help files and forums on how to do static IP addresses and port-forwarding in a tether.

(If the usb dongle does not show in the "Name:" dropdown, I don't know what else to do. As a recommendation, if you setup is a tether to the Android phone as I have guessed, edit your first post and change the title to say "Connect to Ubuntu guest via Android phone tether" and others may be able to advise better.)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to Ubuntu virtual machine remotely via intern

Post by scottgus1 »

I did a google on the "Huawei USB dongle" and found it is a 3G cell-system access point too. So maybe you're not tethering to the android phone, but the USB dongle is accessing the cell company's data plan directly? If so, the USB dongle is the router. You'll have to figure out how to port-forward in the dongle's driver program. Bridged is probably still the way to try the Virtualbox network first.
Joejen
Posts: 3
Joined: 17. Apr 2015, 15:50

Re: Connecting to Ubuntu virtual machine remotely via intern

Post by Joejen »

Thank you very much for the detailed suggestions, scottgus1! :D

I will try what you have suggested and get back in a few days.

Thanks!
Post Reply