├── X └── run ├── LICENSE ├── initialize-graphics ├── tools ├── aws-ebs-create-volume-and-format.sh └── aws-nvidia.sh ├── Dockerfile └── README.md /X/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################ 4 | # Copyright (c) 2015 Jonathan Yantis 5 | # Released under the MIT license 6 | ############################################################ 7 | 8 | /usr/bin/initialize-graphics 9 | 10 | # Launch the X server 11 | /usr/bin/X 12 | 13 | # vim:set ts=2 sw=2 et: 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jonathan Yantis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /initialize-graphics: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################ 4 | # Copyright (c) 2015 Jonathan Yantis 5 | # Released under the MIT license 6 | ############################################################ 7 | 8 | # Is the host using Nvidia drivers? 9 | if [ -f /proc/driver/nvidia/version ]; 10 | then 11 | 12 | # If it is my unique version (modified to make sure only I have it) 13 | # Then just start X so it doesn't take over my screens. 14 | CHECKSUM=$(md5sum /proc/driver/nvidia/version | cut -b1-32) 15 | if [[ $CHECKSUM = "d2a02e1560be195870db33679a77d3e5" ]] 16 | then 17 | echo "X Server Disabled" 18 | exit 0 19 | fi 20 | 21 | # Might be cleaner to remove the mesa libraries once 22 | # But doing it this way allows the user to still use mesa 23 | # If all else fails. 24 | 25 | # Get the string that has the version info from the host 26 | NVIDIA=$(cat /proc/driver/nvidia/version | grep NVRM) 27 | 28 | # Is this the 304 series? 29 | if [[ $NVIDIA == *" 304."* ]] 30 | then 31 | cd /root/nvidia/304/ 32 | pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl 33 | pacman -U --noconfirm *.xz 34 | fi 35 | 36 | # Is this the 340 series? 37 | if [[ $NVIDIA == *" 340."* ]] 38 | then 39 | cd /root/nvidia/340/ 40 | pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl 41 | pacman -U --noconfirm *.xz 42 | fi 43 | 44 | # Is this the 346 series? 45 | if [[ $NVIDIA == *" 346."* ]] 46 | then 47 | cd /root/nvidia/346/ 48 | pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl 49 | pacman -U --noconfirm *.xz 50 | fi 51 | 52 | # Is it version 367 (BETA) ? 53 | if [[ $NVIDIA == *" 367."* ]] 54 | then 55 | cd /root/nvidia/367/ 56 | pacman --noconfirm -Rdd mesa-libgl lib32-mesa-libgl 57 | pacman -U --noconfirm *.xz 58 | fi 59 | 60 | # Configure for headless operation for all GPUs on the system. 61 | /usr/bin/nvidia-xconfig --query-gpu-info | \ 62 | grep BusID | \ 63 | cut -d \ -f6 | \ 64 | xargs -I{} nvidia-xconfig --use-display-device=none --busid={} 65 | fi 66 | 67 | # vim:set ts=2 sw=2 et: 68 | -------------------------------------------------------------------------------- /tools/aws-ebs-create-volume-and-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################ 4 | # Copyright (c) 2015 Jonathan Yantis 5 | # Released under the MIT license 6 | ############################################################ 7 | 8 | # This script will create a new EBS volume and format it. 9 | # Usage: aws-ebs-create-volume-and-format 100 10 | # (That would create and new volume of 100 GB and format it) 11 | 12 | # You must have aws cli installed. 13 | # https://github.com/aws/aws-cli 14 | # If using Arch Linux it is on the AUR as aws-cli 15 | 16 | # This uses just basic Amazon Linux for simplicity. 17 | # Amazon Linux AMI 2015.03.0 x86_64 HVM 18 | ############################################################ 19 | 20 | # USER DEFINABLE (NOT OPTIONAL) 21 | KEYNAME=yantisec2 # Private key name 22 | SUBNETID=subnet-d260adb7 # VPC Subnet ID 23 | 24 | # USER DEFINABLE (OPTIONAL) 25 | REGION=us-west-2 26 | AVAILABILITY_ZONE=us-west-2a 27 | IMAGEID=ami-e7527ed7 28 | 29 | # Create our new instance 30 | ID=$(aws ec2 run-instances \ 31 | --image-id ${IMAGEID} \ 32 | --key-name ${KEYNAME} \ 33 | --instance-type t2.micro \ 34 | --region ${REGION} \ 35 | --subnet-id ${SUBNETID} | \ 36 | grep InstanceId | awk -F\" '{print $4}') 37 | 38 | # Sleep 10 seconds here. Just to give it time to be created. 39 | sleep 10 40 | echo "Instance ID: $ID" 41 | 42 | # Create our new volume 43 | VOLUMEID=$(aws ec2 create-volume \ 44 | --size $2 \ 45 | --region $REGION \ 46 | --availability-zone $AVAILABILITY_ZONE \ 47 | --volume-type gp2 | \ 48 | grep VolumeId | awk -F\" '{print $4}') 49 | 50 | # Sleep 5 seconds here. Just to give it time to be created. 51 | sleep 5 52 | echo "Volume ID: $VOLUMEID" 53 | 54 | # Query every second until we get our IP. 55 | while [ 1 ]; do 56 | IP=$(aws ec2 describe-instances --instance-ids $ID | \ 57 | grep PublicIpAddress | \ 58 | awk -F\" '{print $4}') 59 | 60 | if [ -n "$IP" ]; then 61 | echo "IP Address: $IP" 62 | break 63 | fi 64 | sleep 1 65 | done 66 | 67 | # Sleep 30 seconds here. To give it even more time for the instance 68 | # to get to a "running state" so we can attach the volume properly. 69 | sleep 30 70 | 71 | # Attach our new EBS volume here 72 | aws ec2 attach-volume \ 73 | --instance-id $ID \ 74 | --volume-id $VOLUMEID \ 75 | --device /dev/xvdh 76 | 77 | # Connect to the server and format the volume 78 | # then quickly mount and umount it to make sure it works. 79 | ssh -o ConnectionAttempts=255 \ 80 | -o StrictHostKeyChecking=no \ 81 | -i $HOME/.ssh/${KEYNAME}.pem\ 82 | ec2-user@$IP -tt << EOF 83 | sudo mkfs -t ext4 /dev/xvdh 84 | mkdir /home/ec2-user/external 85 | sudo mount /dev/xvdh /home/ec2-user/external 86 | sudo lsblk 87 | sudo ls -l /home/ec2-user/external 88 | sudo umount /dev/xvdh 89 | sudo nohup shutdown 1 & 90 | exit 91 | EOF 92 | 93 | # Detach our volume since we are done with it. 94 | aws ec2 detach-volume \ 95 | --instance-id $ID \ 96 | --volume-id $VOLUMEID \ 97 | --device /dev/xvdh 98 | 99 | # Now that we are done. Delete the instance. 100 | aws ec2 terminate-instances --instance-ids $ID 101 | 102 | echo $VOLUMEID should be formated as ext4 and ready to use 103 | -------------------------------------------------------------------------------- /tools/aws-nvidia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################ 4 | # Copyright (c) 2015 Jonathan Yantis # 5 | # Released under the MIT license # 6 | ############################################################ 7 | # # 8 | # If you want to try this out just use this script to launch 9 | # and connect on an AWS EC2 instance. 10 | # 11 | # IMPORTANT: make sure to change the userdefined variables 12 | # 13 | # You must have aws cli installed. 14 | # https://github.com/aws/aws-cli 15 | # 16 | # If using Arch Linux it is on the AUR as aws-cli 17 | # 18 | # This uses one of the AMIs from 19 | # https://www.uplinklabs.net/projects/arch-linux-on-ec2/ 20 | # Usage: 21 | # aws-nvidia.sh volumeid 22 | # 23 | # Example: 24 | # aws-nvidia.sh vol-f49d8ca2 25 | # # 26 | ############################################################ 27 | 28 | # WARNING: THESE INSTANCES ARE 65+ cents an hour. 29 | 30 | ############################################################ 31 | 32 | # USER DEFINABLE (NOT OPTIONAL) 33 | KEYNAME=yantisec2 # Private key name 34 | SUBNETID=subnet-d260adb7 # VPC Subnet ID 35 | VOLUMEID=$2 # (this is your external volume to save your files to) 36 | 37 | # USER DEFINABLE (OPTIONAL) 38 | REGION=us-west-2 39 | IMAGEID=ami-71be9041 40 | 41 | # Exit the script if any statements returns a non true (0) value. 42 | set -e 43 | 44 | # Exit the script on any uninitialized variables. 45 | set -u 46 | 47 | # Exit the script if the user didn't specify at least one argument. 48 | if [ "$#" -ne 1 ]; then 49 | echo "Error: You need to specifiy a volume id" 50 | exit 1 51 | fi 52 | 53 | # Create our new instance 54 | ID=$(aws ec2 run-instances \ 55 | --image-id ${IMAGEID} \ 56 | --key-name ${KEYNAME} \ 57 | --instance-type g2.2xlarge \ 58 | --region ${REGION} \ 59 | --subnet-id ${SUBNETID} | \ 60 | grep InstanceId | awk -F\" '{print $4}') 61 | 62 | # Sleep 10 seconds here. Just to give it time to be created. 63 | sleep 10 64 | echo "Instance ID: $ID" 65 | 66 | 67 | # Query every second until we get our IP. 68 | while [ 1 ]; do 69 | IP=$(aws ec2 describe-instances --instance-ids $ID | \ 70 | grep PublicIpAddress | \ 71 | awk -F\" '{print $4}') 72 | 73 | if [ -n "$IP" ]; then 74 | echo "IP Address: $IP" 75 | break 76 | fi 77 | 78 | sleep 1 79 | done 80 | 81 | # Sleep 30 seconds here. To give it even more time for the instance 82 | # to get to a "running state" so we can attach the volume properly. 83 | sleep 30 84 | 85 | # Attach our EBS volume here so we can save some stuff. 86 | aws ec2 attach-volume \ 87 | --instance-id $ID \ 88 | --volume-id $VOLUMEID \ 89 | --device /dev/xvdh 90 | 91 | # Connect to the server and update all the drivers and install docker 92 | ssh -o ConnectionAttempts=255 \ 93 | -o StrictHostKeyChecking=no \ 94 | -i $HOME/.ssh/${KEYNAME}.pem\ 95 | root@$IP -tt << EOF 96 | pacman -Syu --noconfirm 97 | pacman -S --noconfirm btrfs-progs arch-install-scripts 98 | mkfs.btrfs -L docker /dev/xvdb -f 99 | pacman -S docker --noconfirm 100 | mkdir /mnt/docker 101 | mount /dev/xvdb /mnt/docker 102 | sed -i "s/bin\/docker/bin\/docker -g \/mnt\/docker/" /usr/lib/systemd/system/docker.service 103 | systemctl enable docker.service 104 | systemctl start docker.service 105 | useradd --create-home user 106 | mkdir -p /home/user/.ssh 107 | cp /root/.ssh/authorized_keys /home/user/.ssh/ 108 | chown -R user:user /home/user/.ssh/ 109 | echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 110 | sudo mkdir -p /home/user/external 111 | sudo mount /dev/xvdh /home/user/external 112 | sudo chown -R user:user /home/user/external 113 | genfstab -p / >> /etc/fstab 114 | docker pull yantis/ssh-hpn-x 115 | reboot 116 | EOF 117 | 118 | # Connect to the server launch the container 119 | ssh -o ConnectionAttempts=255 \ 120 | -o StrictHostKeyChecking=no \ 121 | -i $HOME/.ssh/${KEYNAME}.pem\ 122 | user@$IP -tt << EOF 123 | sudo nvidia-smi 124 | EOF 125 | 126 | # Add this point it would launch a docker container or just launch it manually. 127 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Copyright (c) 2015 Jonathan Yantis 3 | # Released under the MIT license 4 | ############################################################ 5 | 6 | # ├─yantis/archlinux-tiny 7 | # ├─yantis/archlinux-small 8 | # ├─yantis/archlinux-small-ssh-hpn 9 | # ├─yantis/ssh-hpn-x 10 | # ├─yantis/dynamic-video 11 | 12 | FROM yantis/ssh-hpn-x 13 | MAINTAINER Jonathan Yantis 14 | 15 | # Don't update 16 | RUN pacman -Syy --noconfirm && \ 17 | 18 | # Install common packages. 19 | pacman --noconfirm -S lib32-glibc lib32-zlib lib32-gcc-libs libxdamage libxxf86vm && \ 20 | 21 | # Install the X-server and default to mesa both 32 and 64 bit 22 | pacman --noconfirm -S xorg-server mesa-libgl lib32-mesa-libgl && \ 23 | 24 | # # Download from the AUR and cache the Nvidiia Beta drivers here 25 | # Nvidia beta drivers and Nvidia drivers are the same at this time 26 | 27 | # mkdir -p /root/nvidia/367/ && \ 28 | # pacman --noconfirm -S binutils gcc autoconf make fakeroot && \ 29 | 30 | # # Get the beta drivers from the AUR. We can not use yaourt since the ones in the repos are older. 31 | # # And yaourt defaults to the repos before using the AUR. 32 | 33 | # # nvidia-utils-beta && nvidia-libgl-beta 34 | # wget -P /tmp https://aur.archlinux.org/cgit/aur.git/snapshot/nvidia-utils-beta.tar.gz && \ 35 | # tar -xvf /tmp/nvidia-utils-beta.tar.gz -C /tmp && \ 36 | # chown -R docker:docker /tmp/nvidia-utils-beta && \ 37 | # runuser -l docker -c "(cd /tmp/nvidia-utils-beta && makepkg -sc --noconfirm --pkg nvidia-utils-beta --pkg nvidia-libgl-beta)" && \ 38 | # mv /tmp/nvidia-utils-beta/*.xz /root/nvidia/367/ && \ 39 | 40 | # # lib32-nvidia-utils-beta && lib32-nvidia-libgl-beta 41 | # wget -P /tmp https://aur.archlinux.org/cgit/aur.git/snapshot/lib32-nvidia-utils-beta.tar.gz && \ 42 | # tar -xvf /tmp/lib32-nvidia-utils-beta.tar.gz -C /tmp && \ 43 | # chown -R docker:docker /tmp/lib32-nvidia-utils-beta && \ 44 | # runuser -l docker -c "(cd /tmp/lib32-nvidia-utils-beta && makepkg -sc --noconfirm --pkg lib32-nvidia-utils-beta --pkg lib32-nvidia-libgl-beta)" && \ 45 | # mv /tmp/lib32-nvidia-utils-beta/*.xz /root/nvidia/367/ && \ 46 | 47 | # # Remove build dependencies. 48 | # pacman --noconfirm -Rs binutils gcc autoconf make fakeroot && \ 49 | 50 | # Download and cache the Nvidia 304 drivers for run time. 51 | mkdir -p /root/nvidia/304/ && \ 52 | pacman --noconfirm \ 53 | -Sw \ 54 | --cachedir /root/nvidia/304 \ 55 | nvidia-304xx-libgl \ 56 | nvidia-304xx-utils \ 57 | lib32-nvidia-304xx-libgl \ 58 | lib32-nvidia-304xx-utils && \ 59 | 60 | # Download and cache the Nvidia 340 drivers for run time. 61 | mkdir -p /root/nvidia/340/ && \ 62 | pacman --noconfirm \ 63 | -Sw \ 64 | --cachedir /root/nvidia/340 \ 65 | nvidia-340xx-libgl \ 66 | nvidia-340xx-utils \ 67 | lib32-nvidia-340xx-libgl \ 68 | lib32-nvidia-340xx-utils && \ 69 | 70 | # Download and cache the Nvidia 367 drivers for run time. 71 | mkdir -p /root/nvidia/367/ && \ 72 | pacman --noconfirm \ 73 | -Sw \ 74 | --cachedir /root/nvidia/367 \ 75 | nvidia-libgl \ 76 | nvidia-utils \ 77 | lib32-nvidia-utils \ 78 | lib32-nvidia-libgl && \ 79 | 80 | ######################################################################### 81 | # CLEAN UP SECTION - THIS GOES AT THE END # 82 | ########################################################################## 83 | 84 | # Clean up all the nvidia downloads and installs directories 85 | # rm -r /tmp/* && \ 86 | 87 | localepurge && \ 88 | 89 | # Remove man and docs 90 | rm -r /usr/share/man/* && \ 91 | rm -r /usr/share/doc/* && \ 92 | 93 | # Delete any backup files like /etc/pacman.d/gnupg/pubring.gpg~ 94 | find /. -name "*~" -type f -delete && \ 95 | 96 | bash -c "echo 'y' | pacman -Scc >/dev/null 2>&1" && \ 97 | paccache -rk0 >/dev/null 2>&1 && \ 98 | pacman-optimize && \ 99 | rm -r /var/lib/pacman/sync/* 100 | ######################################################################### 101 | 102 | ADD X /service/X 103 | ADD initialize-graphics /usr/bin/initialize-graphics 104 | CMD /init 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-dynamic-video 2 | Dynamic Video Drivers with optional X-Server on Docker. (Should work with Mesa & Nvidia 304.XX, 340.XX, and 367.XX series drivers) 3 | Includes all 32 bit & 64 bit libraries as well so it should work out of the box with 4 | [VirtualGL](https://github.com/yantis/docker-virtualgl), Wine, PlayonLinux etc. 5 | 6 | The default mode is to start up the X-Server and SSH daemon but if you start it up with any command it will just default to that and not start up any servers. 7 | Though if you do not startup any servers you do need to do the first time video initialization yourself. See the local usage section below. 8 | 9 | On Docker hub [dynamic-video](https://registry.hub.docker.com/u/yantis/dynamic-video/) 10 | on Github [docker-dynamic-video](https://github.com/yantis/docker-dynamic-video) 11 | 12 | 13 | ### Docker Images Structure 14 | >[yantis/archlinux-tiny](https://github.com/yantis/docker-archlinux-tiny) 15 | >>[yantis/archlinux-small](https://github.com/yantis/docker-archlinux-small) 16 | >>>[yantis/archlinux-small-ssh-hpn](https://github.com/yantis/docker-archlinux-ssh-hpn) 17 | >>>>[yantis/ssh-hpn-x](https://github.com/yantis/docker-ssh-hpn-x) 18 | >>>>>[yantis/dynamic-video](https://github.com/yantis/docker-dynamic-video) 19 | >>>>>>[yantis/virtualgl](https://github.com/yantis/docker-virtualgl) 20 | >>>>>>>[yantis/wine](https://github.com/yantis/docker-wine) 21 | 22 | 23 | # Description 24 | The goal of this was a layer between [ssh-hpn-x](https://github.com/yantis/docker-ssh-hpn-x) and graphical applications. 25 | That would just work with whatever video hardware someone had. Right now it defaults to Mesa but if it sees 26 | that the host is using an Nvidia driver it will switch over to that one. It should support all Nvidia drivers. 27 | This could also easily do the same for ATI but as I don't have one of those cards I am unable to test it. 28 | You can fork this and add it yourself or if you send me SSH access to a server with an ATI card I can build it in as well. 29 | 30 | It works well with [VirtualGL](https://github.com/yantis/docker-virtualgl). I have ran Blender as well as even Path of Exile on an Amazon EC2 GPU instance via 31 | [VirtualGL](https://github.com/yantis/docker-virtualgl) and PlayOnLinux. 32 | All in a Docker container. Checkout my Dockerfiles for these (If I didn't get around to putting them up. Just ask.) 33 | 34 | 35 | ## Usage (Local) 36 | 37 | This example launches the container and initializes the graphcs with your drivers and in this case 38 | runs nvidia-smi to get video card information. 39 | 40 | ```bash 41 | xhost +si:localuser:$(whoami) >/dev/null 42 | docker run \ 43 | --privileged \ 44 | --rm \ 45 | -ti \ 46 | -e DISPLAY \ 47 | -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ 48 | -u docker \ 49 | yantis/dynamic-video /bin/bash -c "sudo initialize-graphics >/dev/null 2>/dev/null; nvidia-smi;" 50 | ``` 51 | 52 | ### Breakdown 53 | 54 | ```bash 55 | $ xhost +si:localuser:yourusername 56 | ``` 57 | 58 | Allows your local user to access the xsocket. Change yourusername or use $(whoami) or $USER if your shell supports it. 59 | 60 | ```bash 61 | docker run \ 62 | --privileged \ 63 | --rm \ 64 | -ti \ 65 | -e DISPLAY \ 66 | -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ 67 | -u docker \ 68 | yantis/dynamic-video /bin/bash -c "sudo initialize-graphics >/dev/null 2>/dev/null; nvidia-smi;" 69 | ``` 70 | 71 | This follows these docker conventions: 72 | 73 | * `-ti` will run an interactive session that can be terminated with CTRL+C. 74 | * `--rm` will run a temporary session that will make sure to remove the container on exit. 75 | * `-e DISPLAY` sets the host display to the local machines display. 76 | * `-v /tmp/.X11-unix:/tmp/.X11-unix:ro` bind mounts the X11 socks on your local machine to the containers and makes it read only. 77 | * `-u docker` sets the user to docker. (or you could do root as well) 78 | * `yantis/dynamic-video /bin/bash -c "sudo initialize-graphics >/dev/null 2>/dev/null; nvidia-smi;"` 79 | you need to initialize the graphics or otherwise it won't adapt to your graphics drivers and may not work. 80 | 81 | 82 | ## Usage (Remote) 83 | 84 | This example launches the container in the background. 85 | Warning: Do not run this on your primary computer in remote mode as it will launch another X server that take over 86 | your video cards and you will have to shutdown the container to get them back. 87 | 88 | ```bash 89 | docker run \ 90 | --privileged \ 91 | -d \ 92 | -v /home/user/.ssh/authorized_keys:/authorized_keys:ro \ 93 | -h docker \ 94 | -p 49154:22 \ 95 | yantis/dynamic-video 96 | ``` 97 | 98 | This follows these docker conventions: 99 | 100 | * `--privileged` run in privileged mode 101 | If you do not want to run in privliged mode you can mess around with these: 102 | 103 | AWS `--device=/dev/nvidia0:/dev/nvidia0` \ 104 | `--device=/dev/nvidiactl:/dev/nvidiactl` \ 105 | `--device=/dev/nvidia-uvm:/dev/nvidia-uvm` \ 106 | 107 | OR (Local) `--device=/dev/dri/card0:/dev/dri/card0` \ 108 | 109 | * `-d` run in daemon mode 110 | * `-h docker` sets the hostname to docker. (not really required but it is nice to see where you are.) 111 | * `-v $HOME/.ssh/authorized_keys:/authorized_keys:ro` Optionaly share your public keys with the host. 112 | This is particularlly useful when you are running this on another server that already has SSH. Like an 113 | Amazon EC2 instance. WARNING: If you don't use this then it will just default to the user pass of docker/docker 114 | (If you do specify authorized keys it will disable all password logins to keep it secure). 115 | 116 | * `-p 49158:22` port that you will be connecting to. 117 | * `yantis/dynamic-video` the default mode is SSH server with the X-Server so no need to run any commands. 118 | 119 | Now just SSH into it and use it (See [docker-virtualgl](https://github.com/yantis/docker-virtualgl) for how to access it and usage etc.) 120 | 121 | 122 | # Tested 123 | * Macbook Retina with Mesa drivers. 124 | 125 | * Nvidia 349.xx OK (Current Beta Drivers) 126 | ![](http://yantis-scripts.s3.amazonaws.com/screenshot_20150412-070107.jpg) 127 | 128 | * Nvidia 346.xx OK (Current Generation Drivers) (This one is an Amazon EC2 GPU instance) 129 | ![](http://yantis-scripts.s3.amazonaws.com/screenshot_20150412-071934.jpg) 130 | 131 | * Nvidia 340.xx OK (Previous Generation Drivers) 132 | ![](http://yantis-scripts.s3.amazonaws.com/screenshot_20150412-071443.jpg) 133 | 134 | --------------------------------------------------------------------------------