Whonix Gateway - NAT network

So I have two connections on my pc, one Wifi (Will be used for Host) and one wired USB internet(only for quest), I can set it up to work on other VMS but not with whonix gateway.

To alow the VM to get connection I changed it to Virtual Host-Only adapter in the VM Virtual box settings which is then bridged to USB WIFI Adapter.

Also another way is to change settings of the VM in virtual box and select the USB Wifi adapter under bridge adapters.

I assume Whonix has a check on it to see if the VM setting is sat to “NAT”

Is there way to change this? I believe there must be a setting I must change in Whonix since this setup works for other VMS

** Note **
On the adapter properties I have unchecked everything except VirtualBox NDIS6 Bridged Networking Driver.
This is to stop Windows from using the connection.

Thanks Devs

In the first paragraph you write that wired USB ethernet is used but later on you say you bridge the USB wifi adapter to the VM ??
Anyways, the network configuration is hard coded under /etc/network/interfaces.d/30_non-qubes-whonix. You should configure a static address there corresponding to your local network config.
You could also just attach the USB ethernet adapter to the VM in the VirtualBox config.

Thanks for the Reply,

I was just saying both ways work with a windows VM.

After looking at the config file im still not quite sure what to do since the adapter USBWIFI doesnt
have those settings.


This is because I have unchecked the IPv4.
So what settings would I replace on eth0 config section in the /etc/network/interfaces.d/30_non-qubes-whonix file.

As for the USB Attached to the VM I have tried that route and attached it in VM setting on virtualbox, but not sure what I would to activate that in Whonix.

Thanks, I Appreciate the help.

When you attach the USB to the VM there should be nothing to change on the host network. I can’t test it atm, but when you attach the USB you should get a new network interface. So first remove the first network interface of the VM, then connect the USB adapter and boot it. You should have two interfaces in the VM then with eth0 hopefully being the USB adapter. Then change the static address for eth0 in /etc/network/interfaces.d/30_non-qubes-whonix as well as the gateway.

It looks like you attached the wifi adapter to the VM and not the USB ethernet adapter. Also the first interface is still enabled. Unless there is a driver issue the wifi adapter should still come up in the VM, but since you don’t want to use wifi in the VM anyways …
I just gave it a try on a linux host and the USB interface comes up as eth1 which makes things more complicated …

If you want to use the bridge and it works for other VMs then in theory you just need to change the network address. I don’t know your local network config so easiest is to either check on the host or maybe better on the Windows VM where the bridge works, for the network address. If it is something like in Windows, then for example make the Whonix config look like:
auto eth0
iface eth0 inet static

restart networking, and it should work.

1 Like

Thanks you were very helpful.