VM connected directly to internet

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Leloup78
Posts: 150
Joined: 21. Oct 2017, 15:13

VM connected directly to internet

Post by Leloup78 »

Bonjour,

We had a problem with the fiber. The internet provider is planning to cut off the internet for 5 days while the fiber is being repaired. So I connected the host to 4G with my cell phone by using it as a modem and connecting it to the USB port. OK.
I asked myself the question. If I do the same thing but activate the USB port from guest, does that work?
I tried. That does not work. Why?

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

Re: VM connected directly to internet

Post by scottgus1 »

Leloup78 wrote:If I do the same thing but activate the USB port from guest, does that work?
I tried. That does not work. Why?
Carefully go through USB basics and troubleshooting. If you finish all the steps 1-7 and cannot get your USB device into the guest OS, carefully post the outputs of the commands in step 8 as text, not screenshots. Zip and post the logs step 8 call for, using the forum's Upload Attachment tab.
Leloup78
Posts: 150
Joined: 21. Oct 2017, 15:13

Re: VM connected directly to internet

Post by Leloup78 »

Thank you scottgus1 for all this very useful information to debug the USB port and sorry, my explanations were not clear.
The USB port works very well. The question is not there.
As explained above, I don't have internet anymore. This is my problem. I am looking for a solution.
The idea is to bring the internet connection directly to the guest via the USB port. I connect my laptop mobile phone to the guest through the USB port. No worries,my laptop mobile phone is well detected by the guest. The host does not see the internet. What seems to me normal and interesting.
However, I expect that guest is connected to internet via my phone working as modem. This is not the case. Why? This is my question.
Probably, something is wrong.
Regards,
Leloup
Last edited by Leloup78 on 22. May 2022, 17:54, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM connected directly to internet

Post by scottgus1 »

There's some confusion here.

From this:
Leloup78 wrote:I connected the host to 4G with my cell phone by using it as a modem and connecting it to the USB port. OK.
I asked myself the question. If I do the same thing but activate the USB port from guest, does that work?
I gather that you are connecting a cell phone through USB to either the host or the guest to get internet from the cell phone through USB.

However, this:
Leloup78 wrote:I connect my laptop to the guest through the USB
says you're not using a cell phone.

What exactly are you doing?
Leloup78
Posts: 150
Joined: 21. Oct 2017, 15:13

Re: VM connected directly to internet

Post by Leloup78 »

Sorry for confusion.
I corrected and replaced "My laptop" by "My mobile phone".
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM connected directly to internet

Post by scottgus1 »

Leloup78 wrote: No worries,my laptop mobile phone is well detected by the guest.
Very good. Assuming this means the VM's OS sees a cell phone attached via USB now, then the OS also needs drivers and software that will tell the OS to see the cell phone as a modem for internet. (I have attached a cell phone to an OS before, and it saw only mass storage.)

You will have to provide the drivers and software for the OS to see the cell phone as an internet source.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VM connected directly to internet

Post by fth0 »

FWIW, a technical term for what you're looking for is "USB Tethering".
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM connected directly to internet

Post by mpack »

IMO this seems over complicated.

It would be better to use the phone as a mobile hotspot, which the host laptop can access using WiFi. VMs can then access Internet using NAT, as normal.

What you can't do is assign USB ownership to a VM and expect the host to be happy about no Internet.
Post Reply