Coder Social home page Coder Social logo

Comments (28)

servebeer avatar servebeer commented on June 25, 2024 1

I think that I finally have this working!

from windows.

kroese avatar kroese commented on June 25, 2024

Where exactly do you see that message "Failed to connect to the server"?

Can you connect via RDP (username: docker, empty password)?

from windows.

servebeer avatar servebeer commented on June 25, 2024

So, it appears that the issue is with how UNRAID is doing networking. By default, it wants to use "Bridge" as the network type. If I try to use it them VNC doesn't work and it can't access the Internet as it is somehow getting a 20.20.20.x address. This range is not defined either on the local network or within UNRAID. If I edit the config and tell it to use the custom defined "br0" network (which maps to my physical, local network), then VNC and RDP do work, but the VM still can't get to the Internet as it is still trying to use a 20.20.20.x address, even though I specifically assigned it to 192.168.100.26. Even running a "ipconfig /renew" pulls that 20.20.20.x address. The br0 network should route the DHCP request to my local physical network and thus pull a 192.168.100.0/24 address, correct?

Screenshot 2024-01-29 090858
Screenshot 2024-01-29 091003

from windows.

servebeer avatar servebeer commented on June 25, 2024

If it helps, here is a screen-shot of my container config:

Screenshot 2024-01-29 091822

from windows.

kroese avatar kroese commented on June 25, 2024

If you want to use the br0 network in unRaid, you must set DHCP=Y container variable or it will not work. See here: https://github.com/qemus/qemu-docker#how-can-the-vm-acquire-an-ip-address-from-my-router how to do it.

That it gets the 20.20.20.x address when DHCP=N is completely normal and by design. It is because I have to tunnel the traffic via NAT from the container IP to the VM and I use this dummy IP address for that. It was not possible to keep the same IP as the container has, so I choose 20.20.20.21. Aside from Windows not knowing its Docker IP, it should give no problem at all. And because the container and the VM have a different IP it allows you to reach port 8006 on the container.

So I have no idea why you have problems with bridge networking, you are the first one. But in any case you can set unraid br0 to macvlan (NOT ipvlan mode) and enable DHCP=Y and there will be no more NAT, no more tunnel, and no more 20.20.20.21. So that should solve your issue.

from windows.

servebeer avatar servebeer commented on June 25, 2024

Ah Ha! That makes sense now. Sorry about the confusion and I do appreciate the quick help! One more question, what is the best what to create multiple containers (i.e. several workstations, a couple of servers, etc.) for a lab environment?

from windows.

servebeer avatar servebeer commented on June 25, 2024

@kroese "set unraid br0 to macvlan (NOT ipvlan mode)" brings up a whole other issue. I had been using macvlan ever since I first started using UNRAID until I started having random server crashes. The UNRAID people told me to us ipvlan, and since I changed, I have not had any issues. Do I have to use macvlan, or is there a way to make ipvlan work?

from windows.

kroese avatar kroese commented on June 25, 2024

The DHCP=Y mode uses a macvtap interface and this doesnt work with ipvlan, because the traffic is delivered to a mac-address.

I never used unRaid, but if you say its unstable with macvlan, they should fix that issue instead of forcing all users to use ipvlan I would say.

from windows.

servebeer avatar servebeer commented on June 25, 2024

Thanks for the follow-up. I am trying to revert back to macvlan. UNRAID is not happy with it as the docker service refuses to start now. I am going to reboot the UNRAID server and see if that helps.

from windows.

servebeer avatar servebeer commented on June 25, 2024

I am thinking that UNRAID does not like WindowsinDocker. I have it reconfigured to use macvlan and I am using the bro network. Now I am getting a new error.

Screenshot 2024-01-29 111711

from windows.

servebeer avatar servebeer commented on June 25, 2024

I tried adding --device-cgroup-rule='c : rwm' to "Post Agruments", but the image still will not start. I'll keep playing around with it to see if I can get it to work.

from windows.

servebeer avatar servebeer commented on June 25, 2024

Well, I have made some progress. I needed to add "--device-cgroup-rule='c : rwm'" to the "Extra Parameters:" under the advanced settings. Now, I have a local IP and it can talk to the Internet. VNC is working fine, but RDP is not. I can live with this, but will try to figure out why RDP isn't working.

from windows.

kroese avatar kroese commented on June 25, 2024

I made a pullrequest to the WindowsinDocker template so that it automaticly includes this device-cgroup-rule from now on. That will make it easier for anyone else in the future.

Very strange that RDP is not working? Unless you enabled the firewall in Windows or something?

from windows.

servebeer avatar servebeer commented on June 25, 2024

That's the first thing that I thought of. I am going to do a packet capture while trying to connect via RDP and see if that tells me anything.

from windows.

servebeer avatar servebeer commented on June 25, 2024

So, yet another issue has arisen. I don't think this is going to play well with UNRAID. I have 1 instance running fine now, so I tried to create a 2nd instance (my goal was to try and build an AD Domain for testing. UNRAID currently supports running up to 2 instances of the same container. However, once I set it up with the exact same settings as the 1st container, it hangs at "Initializing Network" and when I look at the logs, it continuously displays:

RTNETLINK answers: Address already in use
❯ Waiting for address to become available...

I think I will just go back to building full Windows vm's for testing at this time.

I appreciate all of the help trying to get this to work!

from windows.

kroese avatar kroese commented on June 25, 2024

I think it is because I set a fixed MAC address in the code (I never anticipated people running multiple instances). But you can easily workaround it by adding a container variable called MAC and set it to a random mac address. As long as it is not 82:cf:d0:5e:57:66 because that is the hardcoded value.

from windows.

servebeer avatar servebeer commented on June 25, 2024

Cool, let me give that a shot!

from windows.

servebeer avatar servebeer commented on June 25, 2024

Well, I think this might be more trouble than its worth. I am guessing that the storage might be hard-coded as well? I say that because I got the second instance to load, download Win 11, do the initial install, but when it reboots from that, it errors-out with:

BdsDxe: failed to load Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0): Not Found
BdsDxe: loading Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x5,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x5,0x0)/Scsi(0x0,0x0)

from windows.

kroese avatar kroese commented on June 25, 2024

Are you sure you are pointing both containers to a different /storage folder?

from windows.

servebeer avatar servebeer commented on June 25, 2024

from windows.

kroese avatar kroese commented on June 25, 2024

Any updates?

from windows.

HeresJonny avatar HeresJonny commented on June 25, 2024

I think that the issue title is misleading because several issues are mixed here. VNC connection is also problematic in MS Edge, regardless of network settings. However, for network issues:

After your network changes, did you try to uninstall the network device without deleting the driver and then let windows redetect hardware ?

from windows.

kroese avatar kroese commented on June 25, 2024

@HeresJonny What problems did you experience with the VNC viewer in Edge?

from windows.

HeresJonny avatar HeresJonny commented on June 25, 2024

I don't really wish to hijack this thread, but noVNC will not work in a normal MS Edge (Version 121.0.2277.106) tab, showing error "Failed to connect to server". It works in a In-Private-Tab, however. Seems to be a websockify problem. There are several reports about this on the internet but short of "update the browser" I haven't found a solution. The console output is

rfb.js:101  noVNC requires a secure context (TLS). Expect crashes!
RFB @ rfb.js:101
connect @ ui.js:1044
start @ ui.js:126
(anonym) @ ui.js:48
Promise.then (asynchron)
prime @ ui.js:46
(anonym) @ ui.js:1768
websock.js:231  WebSocket connection to 'ws://192.168.1.185:8006/websockify' failed: 
open @ websock.js:231
_connect @ rfb.js:551
_updateConnectionState @ rfb.js:903
RFB @ rfb.js:279
connect @ ui.js:1044
start @ ui.js:126
(anonym) @ ui.js:48
rfb.js:686  WebSocket on-error event
_socketError @ rfb.js:686
_websocket.onerror @ websock.js:268
error (asynchron)
attach @ websock.js:266
open @ websock.js:231
_connect @ rfb.js:551
_updateConnectionState @ rfb.js:903
RFB @ rfb.js:279
connect @ ui.js:1044
start @ ui.js:126
(anonym) @ ui.js:48
Promise.then (asynchron)
prime @ ui.js:46
(anonym) @ ui.js:1768
rfb.js:941  Failed when connecting: Connection closed (code: 1006)
_fail @ rfb.js:941
_socketClose @ rfb.js:660
_websocket.onclose @ websock.js:262
192.168.1.185/:1  The resource http://192.168.1.185:8006/app/images/info.svg was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

from windows.

kroese avatar kroese commented on June 25, 2024

@HeresJonny Are you sure it isnt caused by some extension/adblocker? Because for me it works on MS Edge on Win11 without a private tab?

from windows.

HeresJonny avatar HeresJonny commented on June 25, 2024

@kroese Definitely weird. I've tried disabling all extensions and settings that would block stuff, but no change. Win10 here.

from windows.

HeresJonny avatar HeresJonny commented on June 25, 2024

OK, I've tried on my wife's notebook with W11 and it works there. Will check all my settings again.

from windows.

kroese avatar kroese commented on June 25, 2024

My version of Edge is 121.0.2277.98 so its even a bit older than yours. Maybe you can make it work by clearing the browser cache because I believe in 'Private' incognito mode it does not use the cache so it could explain why it works there.

from windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.