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.
1. Manual method + SSH tunneling
- Download
x11vnc
- Configure a proper SSH server in your host, you should know how, a common/default setup works.
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
- reboot/relogin
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
- 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
- Download virtscreen: https://github.com/kbumsik/VirtScreen
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
andHDMI-1
are working monitors andDP-3
will be our “fake” monitor.- Logout/reboot
- Run
arandr
and see thatDP-3
is enabled but not active - Run
virtscreener
(sudo if needed) - Select a resolution, go to advanced, and in displays select
DP-3
- Then go to VNC server, configure as you wish
- Go to your “screen” device, connect to that VNC server with the VNC client you like and that’s it