spotty-cloud / spotty

Training deep learning models on AWS and GCP instances
https://spotty.cloud
MIT License
492 stars 43 forks source link

Enable Docker X11 Client Via SSH #37

Open jagin opened 5 years ago

jagin commented 5 years ago

Hi Oleg,

would it be possible to enable running a GUI program using SSH X11 forwarding?

Something like: https://stackoverflow.com/questions/40884589/x11-forward-to-windows-x-server-for-docker-client-in-aws

It would be nice feature especially when you work with OpenCV and video and want to quickly show the results on your host.

Regards, Jarek

apls777 commented 5 years ago

Hi Jarek,

Thanks for the idea, I will have a look into it this week.

Best regards, Oleg

apls777 commented 5 years ago

@jagin, I tried different solutions that I found on StackOverflow, but because I have a lack of understanding of how exactly X11 works, unfortunately, I couldn't make X11 forwarding work from inside of a container.

I will leave it here and, hopefully, this feature will find its contributor :).

Tarang commented 4 years ago

There's potentially a way to do this:

On the host you would have to create a ssh profile to tunnel into the docker container (make sure port 22 is exposed though)

Host container
    Hostname localhost
    Port 22
    User root
    ForwardX11 yes
    ForwardX11Trusted yes

Then you would ssh into the host with the -X flag (not quite sure how to do this with tmux, or whether it can work given it would have to ssh from an X11 terminal

ssh -X root@host

Once you're in the host you can ssh into the container

ssh -x container

Then run your command and X11 windows should work on your local machine