How to use your ipad/laptop as a second/third monitor

Literally what the title says.

I present two methods, manual or virtscreen. Manual is preferred. Use SSH tunneling in untrusted networks, if not, don’t use it to reduce delay. Or if you are able to install a SSL certificate on the client, use SSL with the x11vnc -ssl parameter.

FTSdUp.png

MmR5KP.png

1. Manual method + SSH tunneling

  1. Download x11vnc
  2. Configure a proper SSH server in your host, you should know how, a common/default setup works.
  3. If running propietary nvidia drivers go to nvim /etc/X11/xorg.conf.d/20-nvidia.conf (or your X11 screen related stuff) and put:

    Section "Screen"
    	Driver "nvidia"
            Option         "MetaModes" "HDMI-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120"
            Option         "MetaModes" "HDMI-1: 1920x1200_60 +0+0, HDMI-1: 1920x1080_60 +1920+120"
            Option         "ConnectedMonitor" "HDMI-0, HDMI-1, DP-3"
    EndSection
    
  4. reboot/relogin
  5. Put the following in a script:

    #!/bin/sh
    xrandr --output DVI-D-0 --off --output HDMI-0 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI-1 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-0 --off --output DP-1 --off --output DP-2 --off --output DP-3 --mode 1024x768 --pos 3840x0 --rotate normal
    x11vnc -clip 1024x768+3840+0 -localhost -repeat -rfbport 5900 -ncache 10
    
  6. Connect to your SSH host with VNC+SSH tunneling client

If you don’t want SSH tunneling just remove the localhost part and connect through regular VNC clients. Remember to setup a proper authentication mechanism in that case, or if the network is untrusted setup SSL.

The only app for iPad that does VNC+SSH is Remoter Pro. I don’t like it, neither the price, but AFAIK it’s the only option (except for another app which is not greater).

2. Virtscreen method

  1. Download virtscreen: https://github.com/kbumsik/VirtScreen
  2. Ensure you have a tray running (not using dwm). If not, download trayer and run it.

    Now, if running propietary nvidia drivers go to nvim /etc/X11/xorg.conf.d/20-nvidia.conf (or your X11 screen related stuff) and put:

    Section "Screen"
    	Driver "nvidia"
            Option         "MetaModes" "HDMI-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120"
            Option         "MetaModes" "HDMI-1: 1920x1200_60 +0+0, HDMI-1: 1920x1080_60 +1920+120"
            Option         "ConnectedMonitor" "HDMI-0, HDMI-1, DP-3"
    EndSection
    

    Making sure that HDMI-0 and HDMI-1 are working monitors and DP-3 will be our “fake” monitor.

  3. Logout/reboot
  4. Run arandr and see that DP-3 is enabled but not active
  5. Run virtscreener (sudo if needed)
  6. Select a resolution, go to advanced, and in displays select DP-3
  7. Then go to VNC server, configure as you wish
  8. Go to your “screen” device, connect to that VNC server with the VNC client you like and that’s it