Windows VM: RDP connects too early, “Connection reset by peer”, VM auto-stops
System details
i5 8350u, Intel UHD 620, Omarchy 3.10
What's wrong?
Launching the Windows VM from the desktop entry or via omarchy-windows-vm launch does not open an RDP window. The CLI attempt shows FreeRDP errors and the VM container is stopped automatically. Desktop entry only shows a notification and then appears to do nothing.
omarchy master ❯ omarchy-windows-vm launch
Starting Windows VM...
[+] Running 2/2
✔ Network windows_default Created 0.2s
✔ Container omarchy-windows Started 0.9s
Waiting for Windows VM to be ready...
┌─────────────────────────────────────┐
│ │
│ Connecting to Windows VM │
│ │
│ VM will auto-stop when RDP closes │
│ │
└─────────────────────────────────────┘
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Using /p is insecure
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Passing credentials or secrets via command line might expose these in the process list
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Consider using one of the following (more secure) alternatives:
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - /args-from: pipe in arguments from stdin, file or file descriptor
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - /from-stdin pass the credential via stdin
[14:14:38:312] [159106:00026d82] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - set environment variable FREERDP_ASKPASS to have a gui tool query for credentials
[14:14:38:326] [159106:00026d84] [WARN][com.freerdp.client.x11] - [load_map_from_xkbfile]: : keycode: 0x08 -> no RDP scancode found
[14:14:38:327] [159106:00026d84] [WARN][com.freerdp.client.x11] - [load_map_from_xkbfile]: ZEHA: keycode: 0x5d -> no RDP scancode found
[14:14:41:463] [159106:00026d84] [ERROR][com.freerdp.core.transport] - [transport_read_layer]: BIO_read returned a system error 104: Connection reset by peer
[14:14:41:464] [159106:00026d84] [ERROR][com.freerdp.core] - [transport_read_layer]: ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
[14:14:44:535] [159106:00026d84] [ERROR][com.freerdp.core.transport] - [transport_read_layer]: BIO_read returned a system error 104: Connection reset by peer
[14:14:44:536] [159106:00026d84] [ERROR][com.freerdp.core] - [transport_read_layer]: ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
[14:14:44:536] [159106:00026d84] [ERROR][com.freerdp.core] - [freerdp_connect]: freerdp_post_connect failed
RDP session closed. Stopping Windows VM...
[+] Running 2/2
✔ Container omarchy-windows Removed 26.5s
✔ Network windows_default Removed 0.2s
Windows VM stopped.
Adjusting the delay for the RDP service time to fully initialize after port opens works. Maybe its due to less performing hardware that takes longer for the service to wake up.
# Give it a moment more to fully initialize
sleep 3
# NEW adjust to couple more seconds
echo "RDP port is open. Finalizing startup..."
sleep 20
Looks like I have the same issue:
~ ❯ omarchy-windows-vm launch
Starting Windows VM...
[+] Running 2/2
✔ Network windows_default Created 0.0s
✔ Container omarchy-windows Started 0.1s
Waiting for Windows VM to be ready...
┌─────────────────────────────────────┐
│ │
│ Connecting to Windows VM │
│ │
│ VM will auto-stop when RDP closes │
│ │
└─────────────────────────────────────┘
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Using /p is insecure
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Passing credentials or secrets via command line might expose these in the process list
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: Consider using one of the following (more secure) alternatives:
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - /args-from: pipe in arguments from stdin, file or file descriptor
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - /from-stdin pass the credential via stdin
[18:29:34:944] [5640:00001608] [WARN][com.freerdp.client.common.cmdline] - [warn_credential_args]: - set environment variable FREERDP_ASKPASS to have a gui tool query for credentials
[18:29:34:945] [5640:0000160a] [WARN][com.freerdp.client.x11] - [load_map_from_xkbfile]: : keycode: 0x08 -> no RDP scancode found
[18:29:34:945] [5640:0000160a] [WARN][com.freerdp.client.x11] - [load_map_from_xkbfile]: ZEHA: keycode: 0x5d -> no RDP scancode found
[18:29:34:954] [5640:0000160a] [ERROR][com.freerdp.core.transport] - [transport_read_layer]: BIO_read returned a system error 104: Connection reset by peer
[18:29:34:954] [5640:0000160a] [ERROR][com.freerdp.core] - [transport_read_layer]: ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
[18:29:34:961] [5640:0000160a] [ERROR][com.freerdp.core.transport] - [transport_read_layer]: BIO_read returned a system error 104: Connection reset by peer
[18:29:34:961] [5640:0000160a] [ERROR][com.freerdp.core] - [transport_read_layer]: ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]
[18:29:34:961] [5640:0000160a] [ERROR][com.freerdp.core] - [freerdp_connect]: freerdp_post_connect failed
RDP session closed. Stopping Windows VM...
[+] Running 2/2
✔ Container omarchy-windows Removed 0.1s
✔ Network windows_default Removed 0.0s
Windows VM stopped.
We may need to look into making the final sleep configurable in the launch command here. https://github.com/basecamp/omarchy/blob/master/bin/omarchy-windows-vm#L272-L302
Can you try running with the -k option so it doesn't kill the container and then see if you can connect after allowing a little more time to elapse?
Adjusting the delay for the RDP service time to fully initialize after port opens works. Maybe its due to less performing hardware that takes longer for the service to wake up.
# Give it a moment more to fully initialize sleep 3 # NEW adjust to couple more seconds echo "RDP port is open. Finalizing startup..." sleep 20
I don't know what's considered 'less performing hardware' but I'm running a 9800x3d and have this issue
Same for me. Noticed that on my notebook, that with power connected everything is fine ... with battery, windows starts not fast enough and the docker compose shuts down after a few seconds. -> changing the sleep to 10 works fine for me, but increasing sleeps should not be the final solution
It worked right after I installed VM, but after reboot I have the same issue as OP.
With omarchy-windows-vm launch -k it's possible to keep the container running but I don't know how to connect to it.
I have exactly the same issue: https://discord.com/channels/1390012484194275541/1437314585014304828
Uninstalled and installed quite a few times. Works the first time, but then no, only solution is to reinstall the VM.
Noticed that when exiting Win VM, selecting "Disconnect" instead of "Shut down" seems to keep the VM from locking down (RDP not starting etc), not sure about this (nor really understanding...), but have been able to reboot the Win11 VM several times now.
I did a PR 2 weeks ago (https://github.com/basecamp/omarchy/pull/2780), which should fix that issue. But it's not merged yet. Could you guys may check it out and tell me if this fix is finally working?
I found the same problem with the issue after activating Windows and connecting the Windows login to my Microsoft account. The file ~/.config/windows/docker-compose.yml will no longer have the correct username and password created at the installation for Windows docker and will close the RDP session. I do not recommend adding your password to a plain text file to correct this issue but you can add your microsoft account @hotmail.com etc. My recommendation is to edit ~/.local/share/omarchy/bin/omarchy-windows-vm and removing on line 342 /p:"$WIN_PASS" from the following statement "xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /cert:ignore /title:"Windows VM - Omarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE". I would then run from the command line "omarchy-windows-vm launch" press enter for Domain: and then input your password. You will have to do it each time unless there is a better recommendation.
This indeed seems to be the issue, thanks.
I found the same problem with the issue after activating Windows and connecting the Windows login to my Microsoft account. The file ~/.config/windows/docker-compose.yml will no longer have the correct username and password created at the installation for Windows docker and will close the RDP session.
I did a PR 2 weeks ago (#2780), which should fix that issue. But it's not merged yet. Could you guys may check it out and tell me if this fix is finally working?
I attempted the changes as request with no change in status. I added commit changes f5d0c16, a7d76bf, c3ac950. If I added too many changes at once let me know I'm would like to help. I can pass on my troubleshooting steps in a different method if you would like. At the moment it seems like issue is after you login to the Microsoft account you can no longer login with the conf file credentials at install. I found it has nothing to do with the RDP connects too early as mention by others. I was hoping that was the case because it would be easier to fix.
I found the same problem with the issue after activating Windows and connecting the Windows login to my Microsoft account. The file ~/.config/windows/docker-compose.yml will no longer have the correct username and password created at the installation for Windows docker and will close the RDP session. I do not recommend adding your password to a plain text file to correct this issue but you can add your microsoft account @hotmail.com etc. My recommendation is to edit ~/.local/share/omarchy/bin/omarchy-windows-vm and removing on line 342 /p:"$WIN_PASS" from the following statement "xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /cert:ignore /title:"Windows VM - Omarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE". I would then run from the command line "omarchy-windows-vm launch" press enter for Domain: and then input your password. You will have to do it each time unless there is a better recommendation.
An easier solution to earlier is add the following to line 304 in ~/.local/share/omarchy.bin/omarchy-windows-vm file: # Microsoft Account Login Prompt WIN_PASS=$(zenity --title="Microsoft Account Password" --password) I did not have to edit ~/.config/windows/docker-compose.yml or remove /p:"$WIN_PASS" on line 342 as mentioned earlier to get it to work. You also can run it from Omarchy Apps instead of command line. Let me know if this helps I will post in discord as well.
An easier solution to earlier is add the following to line 304 in ~/.local/share/omarchy.bin/omarchy-windows-vm file: # Microsoft Account Login Prompt WIN_PASS=$(zenity --title="Microsoft Account Password" --password) I did not have to edit ~/.config/windows/docker-compose.yml or remove /p:"$WIN_PASS" on line 342 as mentioned earlier to get it to work. You also can run it from Omarchy Apps instead of command line. Let me know if this helps I will post in discord as well.
Thanks for trying to get this settled. Ran into some issues:
- changed ~/.local/share/omarchy/bin/omarchy-windows-vm file (note the corrected typo in the path) and made changes you proposed
- launched win-vm from the menu, logged into my MS account, which gave an error for some reason (but apparently did log in). Disconnected from the vm
- launched win vm (menu or terminal), will not boot, same error as before
- modified the ~/.config/windows/docker-compose.yml with my MS credentials => VM launches. Obviously not ideal.
Could not find the ~/.local/share/omarchy.bin file you refer to in your first post, perhaps a typo in the file name?
Whilst modifying the docker-compose.yml not ideal, it works for now (on my private laptop) until there is a permanent fix. Thanks again for helping out.
An easier solution to earlier is add the following to line 304 in ~/.local/share/omarchy.bin/omarchy-windows-vm file: # Microsoft Account Login Prompt WIN_PASS=$(zenity --title="Microsoft Account Password" --password) I did not have to edit ~/.config/windows/docker-compose.yml or remove /p:"$WIN_PASS" on line 342 as mentioned earlier to get it to work. You also can run it from Omarchy Apps instead of command line. Let me know if this helps I will post in discord as well.
Thanks for trying to get this settled. Ran into some issues:
- changed ~/.local/share/omarchy/bin/omarchy-windows-vm file (note the corrected typo in the path) and made changes you proposed
- launched win-vm from the menu, logged into my MS account, which gave an error for some reason (but apparently did log in). Disconnected from the vm
- launched win vm (menu or terminal), will not boot, same error as before
- modified the ~/.config/windows/docker-compose.yml with my MS credentials => VM launches. Obviously not ideal.
Could not find the ~/.local/share/omarchy.bin file you refer to in your first post, perhaps a typo in the file name?
Whilst modifying the docker-compose.yml not ideal, it works for now (on my private laptop) until there is a permanent fix. Thanks again for helping out.
You're correct; I made a typo, and I apologize for the error. The file is ~/.local/share/omarchy/bin/omarchy-windows-vm: I edited the original post to correct the issue.
Here are the steps I took to get to the so-called more straightforward solution:
- Run the Omarchy Windows VM install and use the initial browser session to connect my Windows account and activate.
- After conducting the first restart, I had to run 'omarchy-windows-vm launch -k' in the CLI and open the browser using 'http://127.0.0.1:8006' to access the Windows installation. I was running into the same issue as everyone else with the Windows VM not loading correctly.
- I then logged in to Windows with my Microsoft account, thus making it the first option for logging in thereafter.
- Once you have completed that step, then you can add the following to line 304 in ~/.local/share/omarchy.bin/omarchy-windows-vm file: line 304 '# Microsoft Account Login Prompt' (remove both of the ') line 305 WIN_PASS=$(zenity --title="Microsoft Account Password" --password)
- I was able to start the Windows VM from the Omarchy>Apps>Windows, and it can now run as designed using RDP, no longer requiring the use of CLI.
I place it before '# Extract credentials from compose file' so it reads it first. I'm sure an if statement can be used instead to make the bash file more straightforward to use in the future. I also noticed that the username was not required after step 3. I'm still learning how to use bash files correctly, and I only installed Omarchy yesterday. I'm not new to Linux per se, but I still have a lot to learn. I also wish I had provided this much detail from the start; it would have saved time. If you have any other suggestions or tips, please don't hesitate to let me know.
Thanks @cadmium621 for the clear instructions, will try those out.