Lapdock.sh
A script to fully automate the "bare-metal" installation and configuration of a working virtual Linux desktop machine for use with Android desktops like Samsung Dex
(PS: It's also an automation exo-skeleton for proot-distro builds)
Current version: .92
While having an android desktop is nice, it's kind of like a tablet with a desktop layout. It lacks some software and is "almost there" for a business travel laptop replacement. lapdock.sh supplements this by building a fully configured and working desktop OS from scratch directly utilizing the repositories. A "virtual laptop" that essentially runs on top of android, like an app, without root.
The idea isn't new and there are a number of options available. What makes Lapdock.sh different is that it does not download unknown prepackaged tar balls, containers, nor require you to overwrite your existing termux environment, it simply builds a free ready to run virtual Linux desktop system specifically for travel, business, and thin client use straight from the repositories and handles all the configuration so it just works.
lapdock.sh will call on proot-distro to set up a base Debian Bullseye proot file system. It will then log in and install the desktop and all chosen software from scratch. It does this from the Debian Bullseye repository using the package manager. Then it will directly edit configuration files to configure everything so it just works; sound, software, custom taskbar, and even setting display resolution. Fully ready for use on your Lapdock or desktop monitor, just type ./lapdock.sh start then connect with vnc viewer and use.
lapdock.sh is fully configurable, options include: setting your username for login, default password, desired machine name, display resolution, choose which software to install or not install (default enabled are Libre Office, Atril pdf viewer, Ristretto image viewer, Firefox ESR, and Thunderbird email.
Additional default software that can be enabled: Microsoft Visual Studio Code, Chromium, GIMP, gnucash, handbrake, and sound converter. You can also manually add your favorite software). Pick which default theme and icons to use, and whether to also install other themes: Lapdock's default is a modern-retro, other themes include Windows 10, Windows 10 Dark (similar to Kali), MacOS, MacOS Dark, Dracula, and Sweet. Install any or all).
You can also configure how the lapdock os runs when you type ./lapdock.sh start; whether it's isolated from the system or not, if it mounts termux home, runs with a shared tmp for things like wayland or graphics acceleration, mounts your phone or tablet storage, mounts external storage, whether it re-maps low ports to high ports for daemons, and so much more. You can also backup and restore your desktop, reinstall it, restore defaults, or immediately delete it with a single command.
Requirements:
Termux and a VNC viewer app. Root not required.
You will likely need to disable Android's phantom process killer so your desktop does not keep exiting on signal 9 error, see my adbwifi.sh script.
To get it:
Install Termux from http://f-droid.org (The playstore version is broken and no longer updated)
f-droid also has some nice vnc apps, like avnc
From Termux:
apt install wget
wget https://skg574.cotse.net/lapdock.sh
chmod +x lapdock.sh
To use:
Edit the script if you want to change any defaults, then:
./lapdock.sh install all --> install desktop and all enabled software
./lapdock.sh install desktop --> Install just the Desktop
./lapdock.sh start --> start the lapdock, log in as user, launch vnc server
./lapdock.sh start r --> start the lapdock, log in as root, no vnc server
./lapdock.sh backup --> Backs up the lapdock
./lapdock.sh restore --> Restores from previous backup
./lapdock.sh delete --> Immediately deletes the lapdock
./lapdock.sh reinstall --> Deletes then reinstalls the lapdock
./lapdock.sh defaults --> Reinstalls default configs, themes, and scripts.
Planned additions: Builds for Void Linux, OpenSUSE, Ubuntu, Graphics Acceleration, and Waland (when/if the project is ready)