Using tablets as desktop external monitors
This post was originally written in 2018 and is out of date now. But a new and up-to-date post is coming soon.
Both my work laptop and my personal laptop have 15.6-inch "full HD" screens, which are a decent size. But sometimes -- especially when on the go -- I'd like a little more screen real estate. Carrying an extra monitor isn't practical, but I do have a 10-inch tablet that comes with me pretty much everywhere. It has a great (if small) screen and while the technology has existed for a while to allows its use as an external monitor for my laptop, I haven't bothered to do it since I switched to Linux full time.
It's worth noting that I mention tablets, but any mobile device that supports a VNC viewer would work, be it a phone or tablet. Tablets just make a bit more sense to me since they're larger.
I use Linux Mint 19 as my primary operating system, but do have separate hard drives in both laptops for Windows 10 as well. Since they both came with Windows 10 licenses I might as well use them. There are several commercial apps that allow both Android and iOS devices to be used as extra monitors in Windows and MacOS / OS X.
Windows & MacOS are pretty easy
I have had a license for iDisplay for years and have had no issues using it on Windows with both an older iPad and my current Android tablet, a Samsung Galaxy Tab S2. There are a good number of negative reviews, so some people are apparently having issues. But it has always worked reasonably well for me. You can download the desktop component for Windows or Mac OS for free. The app that runs on your mobile device costs money (currently $17.99 for Android and $14.99 for iOS).
Purchasing an app is generally the quickest option on non-Linux systems. My experience in this arena is limited to iDisplay, but I know there are plenty of other good systems out there. They might even have better recent reviews and possibly cost less money. I won't be going into any more detail than that for Windows or MacOS since the focus of this post is primarily Linux and Android, although iOS devices should work as monitors as well.
Configuring a virtual display in Linux
Getting this working on Linux takes a little bit of work, but lots of people have already figured it out and provide easy ways to get things going. I presume anyone reading this will ahve basic familiarity with the command line.
The fist step is to configure a virtual display in Linux. This is generally done via VNC (Virtual network Computing). VNC is a great system that's been around for a good long while, which means it's stable. According to Wikipedia:
In computing, Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.
VNC is platform-independent – there are clients and servers for many GUI-based operating systems and for Java. Multiple clients may connect to a VNC server at the same time. Popular uses for this technology include remote technical support and accessing files on one's work computer from one's home computer, or vice versa.
Setting up the virtual display can be done manually with CLI. The manual setup reuires a decent amount of work and specific knowledge to get going.
Manual is OK; Scripts are better
I don't have a lot of that knowledge and didn't want to go through all of that. Instead, I searched for a solution and found one in the form of a script named exttab. Exttab is a shell script that walks you through the various steps of setting up the virtual display and getting the VNC server running. It also has lots of command line options that make scripting or aliasing it very easy.
There are some requirements:
- Bash (https://www.gnu.org/software/bash/)
- xrandr (https://www.x.org/wiki/)
- x11vnc (https://libvnc.github.io/)
All of these should be either installed by default or readily available on any popular Linux distro. If you've gotten this far, odds are you know how to install these on your Linux system if they're not already there.
Server settings and screen resolution
Once the requirements are met and
exttab is installed, you're a command line away from having the server side of things up and running. You will be asked for a few parameters, including the screen resolution of your device. More accurately, this is the resolution of the virtual screen. The virtual display resolution does not have to match the native resolution of your tablet.
My Samsung Galaxy Tab S2 has a screen resolution of 2048 by 1536 pixels. Doing a 1:1 for a desktop display would render the content too small.Halving this to 1024 by 768 is a logical choice and makes for clean scaling, but doesn't give enough "real estate" for my taste. I actually chose to go 2/3 of resolution (or 1.5 if you're figuring it the other way) and ended up with 1366 by 1024. This scales nicely and gives a decent number of pixel real estate.
There are other settings such as screen number and screen location. Exttab supports setting up two virtual displays, and they can be to the left or right. I have an alias set up to point
exttab to the folder where
exttab.sh is installed.
This is the command I use:
exttab -1 -s left -m 1366x1024. This sets up screen one
-1 on the left
-s left with a pixel resolution of 1366 by 1024
-m 1366x1024. There are other options as well, and they're documented on the GitHub repo: https://github.com/cbodden/exttab
Your device will likely have a different resolution, and you will have to experiment to find the settings you like. Once that's in place some more aliasing in
.bashrc or scripts if you're feeling fancy should get server setup a quick command away.
VNC needs a viewer, too
Now that your computer has a virtual display and it's set up, you will need a VNC viewer app on your tablet. I have tried several for Android and found that bVNC meets my needs. It also works well "out of the box" with my system. There is a free version of bVNC and a pro version that's currently a reasonable $4.99. There are other VNC viewers with various options for Android. iOS has plenty as well. Try a few and use the one that works best for your needs.
Getting the viewer running is easy. Fire up the app on your tablet and use your server computer's address. This can be the IP address, or even its network name. I find the network name to be more useful since it's more consistent. IP addresses change between various networks and I like things as automatic as possible.
Once the tablet connects to the server, your extra monitor should be all set. You might need to change a few display settings on the host machine to get everything synced up, positioned, and working perfectly. That is generally a straightforward process and no different than connecting a physical monitor. Your newly minted monitor should act just like any other monitor with the ability to drag windows on and off of it, maximize windows, and so on.
Security & Performance matter
there are a few factors to consider with this monitor. Unlike a monitor connected via hardware, this one connects via a network. That network is most likely going to be WiFi. Although VNC compresses the video data, there's still a lot to move through a "small pipe". Your virtual display will not refresh like a physical one. It will have a slower response and frame rate. The lack of bandwidth means it probably won't be suitable for video, but text and other non-video content will look fine.
Also beware of which network you are connecting over. If your devices use a cellular connection, you might chew up a lot of data bytes in a very short time.
The setup I have given is a basic "get it working" setup. It does not get into securing the VNC data or encrypting it. On a trusted network, this isn't likely a big deal. On a public network it's a can be a big deal allowing anyone to intercept the video. I will be securing and encrypting my external monitor and will share how I get that set up once I do.
Regardless of the limitations, getting things set up on Linux and using your tablet as an extra monitor is fairly easy.