Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable networking #243

Closed
ghost opened this issue Mar 9, 2024 · 6 comments
Closed

Option to disable networking #243

ghost opened this issue Mar 9, 2024 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2024

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.

@kroese
Copy link
Contributor

kroese commented Mar 10, 2024

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

@Joly0
Copy link

Joly0 commented Mar 11, 2024

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.

@kroese
Copy link
Contributor

kroese commented Mar 11, 2024

@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
Copy link
Contributor

kroese commented Mar 11, 2024

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 kroese closed this as completed Mar 15, 2024
@WSHAPER
Copy link
Contributor

WSHAPER commented May 6, 2024

@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!

@kroese
Copy link
Contributor

kroese commented May 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants