Jump to content

Access web UI from outside a VM?

Go to solution Solved by AlexGoesHigh,

The problem is that your VM network is configured as NAT in virtualbox, you have to go into the VM config and change the network card in "attached as" config from NAT to bridge adapter, that will make the VM connect directly to your network like a physical device and have its own IP given by your router (or whatever device is your DHCP server), also reboot the VM (since its the easiest thing to do) or restart the network inside the VM to apply the network changes (i'm not sure if virtualbox or Linux itself is smart enough to recognize such a change in the network and adapt itself since i have never change this config on a running VM).

 

Another thing you can do is port forward the VM to localhost, again go to the network settings instead of changing from NAT to bridge adapter, press advance and open the port forward button at the bottom of the page and add a rule that binds the guest qbittorrent port to the same port on the host since its not a commonly used port like 80, with this option you don't have to change any config in your VM nor qbittorrent, all you have to do is open localhost:port on your browser to access qbittorrent.

 

If you have more problems post screen of the "ip a" command in linux and your network config in virtualbox

I'm trying to access qBittorrent's web UI from another PC on the same network, but qBittorrent is running inside a Linux VM, so it doesn't just work like it normally would.

 

It's something to do with how the network works inside the VM, and I'm trying to access the web UI from a PC outside of the VM.

 

I'm guessing it's something to do with port forwarding/proxy?

 

Here's some numbers.

HOST:                           Windows 10 Home (1903)

VIRTUALMACHINE:    Oracle VirtualBox (6.1.4 r136177)

VM OS:                         Lubuntu (18.04)

Running qBittorrent (v.4.0.3) AND PIA VPN (v.1.8)

 

Trying to access the web UI from another PC on my home network doesn't work as you can see on the right side of the photo. Whereas it works as expected within the VM on the left.

 

 

image.thumb.png.c686350e33b3d8e562c9881f9cc360e1.png

 

Anyone know how to get this working? (I don't need it to be remote, just simply want to access it when I'm at home).

"Those who are last are sideways and smiling". - Jeremy Clarkson

Link to comment
Share on other sites

Link to post
Share on other sites

Find the IP of the VM and replace "127.0.0.1" with that so that it reads IP:20300

127.0.0.1 is bound as the IP of your local machine and therefore if qbittorrent isn't running on it, you won't see anything appear.

 

Your VPN may also prevent traffic from accessing it.

--- Purple Prime ---
i7 8700k + Hyper 212 Evo | MSI Z370 Gaming Pro CarbonG-Skill Trident Z 3000Mhz RGB 16GB | Gigabyte Aorus GTX 1080ti

Crucial MX500 500GB | WD Black 2TB | Corsair RM850i | Fractal Design Define R4LG 27UD68-P | Logitech G502 + G910 | Windows 10 Pro

--- Proteus Server ---

AyyMD Ryzen 5 3600 | Asrock B450m Pro-4 | Crucial Ballistix Sport LT 32 GB (2 x 16 GB) | Sapphire RX570 NITRO+ 8GB

Crucial MX500 1TB + Samsung Spinpoint F4 2TB + Seagate 1TB 2.5" + 5TB iDrive  | Windows 10 Pro (Temporary)


--- Camera Stuff ---
Canon EOS 77D | Canon EF-S 18-55 f/4-5.6 IS STM | Canon EF-S 55-250 f/4-5.6 IS STM | Canon EF 50mm f/1.8 STM 
Zoom H5 + XY-5
Phone - Oneplus 6T

Link to comment
Share on other sites

Link to post
Share on other sites

28 minutes ago, pbx2 said:

Find the IP of the VM and replace "127.0.0.1" with that so that it reads IP:20300

127.0.0.1 is bound as the IP of your local machine and therefore if qbittorrent isn't running on it, you won't see anything appear.

I used the terminal in the VM with hostname -I | awk '{print $1}' which gave me the IP 10.0.2.15 and I put that in to qBit with 20300 and I'm still getting the same issue.

 

image.png.6a0082592445cfe03753666d9c58a169.png 

 

image.thumb.png.8446f5512392c4a2c5d05cd7a33f3cfe.png

"Those who are last are sideways and smiling". - Jeremy Clarkson

Link to comment
Share on other sites

Link to post
Share on other sites

Firewall could be an issue, Alongside your VPN.

I also see 2 different IPs in the nav bar, Does the one showing the page in your VM work on windows?

--- Purple Prime ---
i7 8700k + Hyper 212 Evo | MSI Z370 Gaming Pro CarbonG-Skill Trident Z 3000Mhz RGB 16GB | Gigabyte Aorus GTX 1080ti

Crucial MX500 500GB | WD Black 2TB | Corsair RM850i | Fractal Design Define R4LG 27UD68-P | Logitech G502 + G910 | Windows 10 Pro

--- Proteus Server ---

AyyMD Ryzen 5 3600 | Asrock B450m Pro-4 | Crucial Ballistix Sport LT 32 GB (2 x 16 GB) | Sapphire RX570 NITRO+ 8GB

Crucial MX500 1TB + Samsung Spinpoint F4 2TB + Seagate 1TB 2.5" + 5TB iDrive  | Windows 10 Pro (Temporary)


--- Camera Stuff ---
Canon EOS 77D | Canon EF-S 18-55 f/4-5.6 IS STM | Canon EF-S 55-250 f/4-5.6 IS STM | Canon EF 50mm f/1.8 STM 
Zoom H5 + XY-5
Phone - Oneplus 6T

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, pbx2 said:

Firewall could be an issue, Alongside your VPN.

I also see 2 different IPs in the nav bar, Does the one showing the page in your VM work on windows?

The one in the nav bar on the left doesn't work for either, not too sure why it was there. 

 

10.0.2.15:20300 works in the VM, and doesn't work with Windows even when I disconnected and quit the VPN. So, it may be the Firewall?

"Those who are last are sideways and smiling". - Jeremy Clarkson

Link to comment
Share on other sites

Link to post
Share on other sites

I have also found out that there are no issues going the opposite way. Programs that are hosted on my normal PC with a web UI like Radarr can be accessed fine from within the VM.

 

image.thumb.png.d2888dac3fe3ad4195c83cfcfc940843.png

"Those who are last are sideways and smiling". - Jeremy Clarkson

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not very familiar with how networking on Virtualbox works but it might have some weird routing that doesn't allow it to be accessed from the host, Have you tried a different computer or a phone? 

--- Purple Prime ---
i7 8700k + Hyper 212 Evo | MSI Z370 Gaming Pro CarbonG-Skill Trident Z 3000Mhz RGB 16GB | Gigabyte Aorus GTX 1080ti

Crucial MX500 500GB | WD Black 2TB | Corsair RM850i | Fractal Design Define R4LG 27UD68-P | Logitech G502 + G910 | Windows 10 Pro

--- Proteus Server ---

AyyMD Ryzen 5 3600 | Asrock B450m Pro-4 | Crucial Ballistix Sport LT 32 GB (2 x 16 GB) | Sapphire RX570 NITRO+ 8GB

Crucial MX500 1TB + Samsung Spinpoint F4 2TB + Seagate 1TB 2.5" + 5TB iDrive  | Windows 10 Pro (Temporary)


--- Camera Stuff ---
Canon EOS 77D | Canon EF-S 18-55 f/4-5.6 IS STM | Canon EF-S 55-250 f/4-5.6 IS STM | Canon EF 50mm f/1.8 STM 
Zoom H5 + XY-5
Phone - Oneplus 6T

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, pbx2 said:

Have you tried a different computer or a phone? 

Yes, same results as from Windows.

 

The ipconfig from the Windows side of things does show this. This is just numbers to me.

 

image.png.bec954ad90545c974d20b7cb050d51f2.png

"Those who are last are sideways and smiling". - Jeremy Clarkson

Link to comment
Share on other sites

Link to post
Share on other sites

The problem is that your VM network is configured as NAT in virtualbox, you have to go into the VM config and change the network card in "attached as" config from NAT to bridge adapter, that will make the VM connect directly to your network like a physical device and have its own IP given by your router (or whatever device is your DHCP server), also reboot the VM (since its the easiest thing to do) or restart the network inside the VM to apply the network changes (i'm not sure if virtualbox or Linux itself is smart enough to recognize such a change in the network and adapt itself since i have never change this config on a running VM).

 

Another thing you can do is port forward the VM to localhost, again go to the network settings instead of changing from NAT to bridge adapter, press advance and open the port forward button at the bottom of the page and add a rule that binds the guest qbittorrent port to the same port on the host since its not a commonly used port like 80, with this option you don't have to change any config in your VM nor qbittorrent, all you have to do is open localhost:port on your browser to access qbittorrent.

 

If you have more problems post screen of the "ip a" command in linux and your network config in virtualbox

this is one of the greatest thing that has happened to me recently, and it happened on this forum, those involved have my eternal gratitude http://linustechtips.com/main/topic/198850-update-alex-got-his-moto-g2-lets-get-a-moto-g-for-alexgoeshigh-unofficial/ :')

i use to have the second best link in the world here, but it died ;_; its a 404 now but it will always be here

 

Link to comment
Share on other sites

Link to post
Share on other sites

You need to bridge the VM's virtual adapter to the hosts. This basically creates a virtual switch which will give your VM an IP address from the local Router enabling you to view the WebUI. You can reserve an IP for the VM if necessary in your router.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×