Snippets

profile://github.com/delan How to run a remote X session on Windows

Created by Delan Azabani
How to run a remote X session on Windows
----------------------------------------

~~~ for cmd ~~~

C:\cygwin64\bin\sh -lc ^"startxwin /bin/ssh -Y virbr0.venus.daz.cat. \''sh -lc '\''\'\'\''eval $^(dbus-launch --sh-syntax^); mate-session; kill $DBUS_SESSION_BUS_PID'\''\'\'\'\' -- -rootless^"

~~~ for other contexts ~~~

C:\cygwin64\bin\run sh -lc "\"startxwin /bin/ssh -Y virbr0.venus.daz.cat. \''sh -lc '\''\'\'\''eval $(dbus-launch --sh-syntax); mate-session; kill $DBUS_SESSION_BUS_PID'\''\'\'\'\' -- -rootless\""

• these commands require Cygwin, but are otherwise as portable as I could make them
• they don’t depend on any particular shells, working directories, or unusual server state
• they start a dedicated X server which quits cleanly, and shows the desktop in a seamless window
• replace C:\cygwin64 and virbr0.venus.daz.cat. and mate-session to your heart’s content
• other contexts include shortcuts, the Run window, and most places that aren’t fancy interpreters
• most applications seem to work perfectly, but there are some minor polkit(?) issues to iron out
• thanks to Øyvind Hvidsten for their approach to making ssh(1) quit cleanly when running virt-manager(1):

http://blog.dhampir.no/content/how-to-prevent-ssh-x-from-hanging-on-exit-when-dbus-is-used

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.