windows icon indicating copy to clipboard operation
windows copied to clipboard

Option to disable networking

Open ghost opened this issue 1 year ago • 4 comments

Attempting to disable networking at the moment using -net none however it does not seem to work. Looking at arguments it seems that the container is passing in its own networking arguments to qemu. An easy way to disable these would be helpful instead of having to work against the container.

ghost avatar Mar 09 '24 22:03 ghost

It would be a simple feature to add, but can you give a specific usecase? Because I cannot come up with one.

kroese avatar Mar 10 '24 10:03 kroese

I guess its for testing new stuff in an isolated environment. Sometimes you gotta need to test a new software and dont know, if you can trust the software or the vendor and you could try it in an enviroment, which is safe(r) to use it in.

Joly0 avatar Mar 11 '24 08:03 Joly0

@Joly0 Yes, but you will not be able to use VNC or RDP in that case, because they both connect over the local network. So I cant see how you can use this container without any network. It would be more logical to just disable internet access, but that it is not what @ghost is doing when setting -net none.

kroese avatar Mar 11 '24 09:03 kroese

I now created a new release (v2.05) which has the option to disable networking while still allowing VNC by setting:

environment:
  NETWORK: "N"

Hope this solves the issue!

kroese avatar Mar 11 '24 13:03 kroese

@kroese is there a way to add RDP in addition to VNC to the exception as well, when NETWORK: "N" is set?

Scenario

When configuring Windows, I would like to disable all internet access to Windows (apart from RDP), to not saturate the network with random requests Windows is making after first install to speed up its initial setup.

Also, I'm sure you're aware, but you can reference this issue using GH-243 in the commit message. I would be happy to contribute, a pointer in any direction would suffice for me. :) Looking forward to your reply, and many thanks in advance!

WSHAPER avatar May 06 '24 13:05 WSHAPER

No, this is not possible. The reason for this is that the VNC server runs on the container-side, and the RDP runs on the Windows-side. So if you disable the network-card in Windows, the VNC will not be affected, but the RDP will. This cannot be solved by making an exception.

What I would do in your case, is to add this to your compose file:

dns:
      - 192.168.99.98
      - 192.168.99.99

This sets the DNS servers of your Windows to some invalid values. That will cause any internet access to fail, because domainname lookups become impossible. But will still allow local network access and RDP.

kroese avatar May 06 '24 13:05 kroese