Friday, October 23, 2020

Old Laptops as Secondary Monitors

Dual screen workflows without screens across operating systems

Background

My X380 sadly has been having port issues. This meant that my M14 was no longer a viable option for my second screen needs.

Outline

The general form of the solution works in one of two ways:

VNC Viewer
Where the (second-screen) laptop connects to a VNC server on the primary laptop
Peripheral Shares
Where the secondary laptop runs a server to enable proxying mouse and keyboard access from the primary laptop

VNC and Windows

For laptops running Windows, I personally just set up TightVNC. The standard settings work well enough for the peripheral share described below.

This is best used for working with Windows only stuff like Office.

VNC and Linux

Peripheral Share

For the secondary laptop we need to run a server (tigervnc) without setting an external screen.

x0vncserver -rfbauth ~/.vnc/passwd

Now on the main laptop, we will simply leverage x2vnc to extend into the secondary laptop.

Where we can get the IP (local) by checking with ifconfig on the secondary laptop.

This works best when combined with a networked file-system, since then you can interact with files in tandem. Otherwise, there is quite a bit of git based back and forth.

VNC and Android

There are two parts to this solution. Note that, as Android devices don’t run X11 systems in a meaningful way, the direct access method is through a paid application, a2vnc server lite, which also did not work well in my tests. We will therefore focus on setting a VNC viewer up to connect to the primary laptop.

Primary Settings

XRandR Setup

For the primary laptop, we will start by obtaining our present screens configuration.

xrandr | grep " connected"
eDP1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 290mm x 170mm

Naturally your output will differ. We also need the resolution of the Android device. In my case, they are the same. At this point we are ready to figure out the mode-line.

# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

Let us now use this information to create a bunch of modelines.

xrandr --newmode "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

Note that we can create more of these in the same manner. We can now move forward with making a virtual screen.

xrandr --addmode VIRTUAL1 1920x1080_60.00

We can now finally set up the output.

xrandr --output VIRTUAL1 --mode 1920x1080_60.00 --left-of eDP1

Note that it is better to use mons to work with our newly created virtual screen.

This is still a bit ugly, since the process needs to be repeated with each reboot.

VNC Setup

Now we need prepare our VNC. x11vnc is recommended at the moment.

x11vnc -vencrypt nodh:only-ssl -ssl SAVE -clip 1920x1080+0+0

Android Settings

For this section, I personally use bVNC Pro. The setup is pretty dead simple. A basic VNC connection is all that is required.

In practice, I use the x86 setup, with the secondary laptop acting as a viewer for a virtual screen, mostly because that way I can tune into multiple Zoom meetings (a bonus).

Conclusion

The final setup is quite robust to changes. Future posts might go into setting up the kind of local networking tools to help move files, code and more between both machines, to improve on the peripheral share approach. Additionally, there are still some manual steps which can and should be automated. I’m not super pleased with the setup, it takes longer than a wireless sceen



from Hacker News https://ift.tt/3dQxrkh

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.