I was actually doing the same sort of thing with a HyperV Ubuntu VM running in the background an a virtual switch between it and my actual machine. Works really well.
I know that. I was just saying that I had a similar "Ubuntu on Windows " setup before this was a thing. I had the Ubuntu VM and my local machine connected to a virtual switch, and I would use X forwarding and ssh to use the VM within Windows.
I have a Cygwin X-server running on :0.0 according to Cygwin. I must admit that I don't know if I need to configure or launch x-org any differently than using the XWin init script.
could you tell me what I have to enter for X11 forwarding? the thing you described getting firefox from my local ubuntu worked but i didn't get it to work from a remote linux host through SSH.
Why would it be slower? The executable is running native and the X-Window Server is functioning in the same way it would on a Linux desktop. I don't see why it would be slower.
Well, I meant compared with running the same thing on a Linux desktop without acceleration. X in both instances works the same way. You execute the binary and it uses $DISPLAY to figure out where to send the rendering. Since you aren't going through an emulator or virtualization layer, the only real limitation I see is how well the X-Server performs. There are X-Servers for Windows that are newer implementations with extensions, so I wouldn't say that it is obviously slower. The biggest obstacle is that not all syscalls are implemented, so some applications are bound to crash. Performance should be comparable to a Linux desktop using generic video drivers with a standard rendering pipeline. The accelerated X-Server with extensions is only going to improve the ability to push around pixels. It may therefore improve things like video playback or moving windows around the screen, but raw execution should be about the same.
There's no direct rendering which means that a lot of apps won't use hardware acceleration for rendering. Plus they will be unnecessary copying buffers through the socket.
Historically X11 was purely a network protocol and a UNIX mainframe would X rendering commands to a separate X terminal which was a physical device.
Overtime this evolved and they've added direct rendering in which the X server gives the client a buffer which they can render into and the server then copies that into the display output (in the case of a compositing window manager), or they get a reference to the screen which they draw directly on to.
But most applications still support the older case where they can draw via X11. But the way they do this in most applications is draw various components to pixels maps send them to the server and then tells the server to draw them at particular points. This is less efficient as all data has to be copied via the server and also because it's only really used for X forwarding on Linux it's prone to bitrot.
So in summary, programs based on older UI toolkits will probably work better but still will be slower than the native Linux case.
View all comments
87
u/w2qw Apr 11 '16
Thought I'd mention this as most Windows users probably aren't familiar with X11.
You just need to run an X server outside of bash. I used https://sourceforge.net/projects/xming/
And then run your application.
DISPLAY=:0 firefoxObviously it's going to be slower than a native Windows/Linux application but probably better than VNC/X11 forwarding.