Press "Enter" to skip to content

Web Development on a Phone. Updated for Linux on DeX

However, there is no reason for consumers to get disheartened as they can use normal Android apps while running Dex and can launch Linux on DeX when they want a complete desktop experience. Basically, it’s a complete package and I am not sure why Samsung isn’t marketing this feature heavily. You can have a PC-like experience with absolutely great performance. It definitely looks like the future. Well done, Samsung!

How to Install Linux on DeX

Samsung has brought Linux support to its DeX ecosystem. DeX was already a great way to get a full-screen desktop experience without the need of a standalone computer. However, it was not an actual desktop. Samsung is changing that by bringing Linux support which will allow users to use a full blown Linux operating system. Samsung has brought Linux support with almost all the features you will need to get started with Linux. With Linux on DeX, you will be able to carry your whole computer in your pocket. Whether you are developer or just a user who prefers Linux OS, this is a great news. In this article, we are going to show you how you can install Linux on Dex on supported devices so that you can live the future right now.

Update: Samsung has closed Linux on DeX Beta. This is the last chance to test this app as it will be discontinued in February 2020.

Use Linux Operating System on Samsung DeX in 2020

Requirement

  • Only a handful of devices are supported right now. In our testing, we are using Galaxy Note 9 (Exynos). Here’s the list of supported devices:
    • Galaxy Note 9
    • Galaxy Tab S4,
    • Galaxy S9 & S9+
    • Galaxy S10, S10e, S10+, S10 5G
    • Galaxt Tab S5e

    Installing Linux on Samsung Dex

    1. Download the latest version of Linux on DeX Beta app (Free) from APKmirror. For some reason, the Play Store link is broken right now and it’s not working. Nonetheless, you can side-load the app from APKmirror, it’s completely safe to use.

    2. Install Linux on DeX Beta app and open it. Tap on the plus button at the bottom and select Download from Server. Now scroll down and tap on the “Download” button. The app will start downloading the required Linux image. It’s a huge file of around 4GB, so make sure you are connected to WiFi. 3. If you face any problem while downloading the image file on mobile, you can download it on your PC first. After it’s downloaded, extract the zip file and import the .img file into the LoD folder on your phone. Now, open Linux on DeX app, tap on the plus button and select Browse.

    4. Here, you will see the .img file, tap on it and provide a name to the container. Now tap on “Create”. The Linux container is now ready to be used on DeX.

    Using Linux on DeX

    1. Now connect the smartphone using Type-C to HDMI connector to your monitor. Samsung DeX will automatically start on the monitor. If you don’t have a wireless mouse and keyboard, you can use Samsung’s display to navigate DeX. Open the app drawer on DeX and click on Linux on DeX Beta app.

    2. After that, click on the container that you have named earlier and then click on the RUN button. If you want to go back to DeX, just hover your mouse at the bottom of the screen for 2-3 seconds, you will get the dock and from there you can close Linux and switch to DeX.

    Note: the default user name is “dextop” and the password is “secret”.

    How is the Overall Experience?

    Frankly speaking, Linux on DeX is fairly responsive and I was surprised to see this kind of performance on a beta channel. To give you a perspective, Linux is running in a container, which is part of the DeX ecosystem, and installed in an app on the Note 9. There are so many layers, yet it performed decently well. There was intermittent lag, but overall applications ran quickly without much latency.

    So far, it seems a good alternative for students or developers who want to get started with Linux. To make it clear, it runs Ubuntu 16.04 LTS with Android Security Policy baked in. If you are a beginner in software development, then you can explore plenty of things. For starters, you have access to Terminal. if you are into Android development, there is IntelliJ pre-installed. This version also comes with Geany text editor and Visual Studio Code which is amazing. Alternatively, you can install Vim or any other text editor of your choice. There is a lot of flexibility for developers.

    If you are not a developer, you will find most of the basic apps here. There is Chromium and Firefox for browsing the internet which works pretty great. YouTube worked really well with minor frame drops. Note that the sound will come out of Note 9’s speaker but you can connect and use external speakers if you want to. Users can use the terminal to install packages they want. However, you might find compatibility issues with software. We tried installing VLC using the terminal, and it did install, but couldn’t run because it’s not ARM compiled. Samsung has already stated that only 64-bit ARM built applications will run.

    However, there is no reason for consumers to get disheartened as they can use normal Android apps while running Dex and can launch Linux on DeX when they want a complete desktop experience. Basically, it’s a complete package and I am not sure why Samsung isn’t marketing this feature heavily. You can have a PC-like experience with absolutely great performance. It definitely looks like the future. Well done, Samsung!

    Enjoy Linux on DeX

    Samsung has done an amazing job of packing a whole desktop opreating system on its smartphone. Linux on DeX program is currently in beta, and surely it will get better with time. When DeX was initially launched in 2017, the performance was choppy and it didn’t exactly feel like a desktop experience.

    However, with few revisions, DeX has become a viable and exciting product to use. Powerful processors, high-speed storage, and wider adoption to ARM will make Linux on DeX a great alternative to use in the future. So what do you think? Will you try installing Linux on your Samsung device? Let us know in the comment section below.

    Web Development on a Phone. Updated for Linux on DeX.

    Last year I wrote about how you can use a phone for web development using an Android Linux Terminal and a simple editor I’d made as a Progressive Web App. It worked pretty well but had some drawbacks, for example you couldn’t debug Samsung Internet on the DeX you had to use an external laptop.

    Since then Samsung has released Linux on DeX as a beta which addresses many of the issues I had previously. I was lucky enough to borrow a Note 9 from work to test out how well I can port my work flow to only need the DeX.

    • Setup [00:00:17]
    • Installing Node [00:04:32]
    • Installing Visual Studio Code [00:05:35]
    • Installing git, zsh and tmux [00:09:23]
    • Copying across my config files into Linux on DeX [00:10:25]
    • Installing GIMP and changing the wallpaper [00:20:02]
    • Testing running a http server [00:21:34]
    • Quitting VIM [00:26:10]
    • Setting up Blender [00:26:18]
    • Testing gamepad support [00:28:17]
    • Testing WebGL [00:30:55]
    • Debugging Samsung Internet on DeX through Chrome on Linux for DeX [00:32:31]

    Setup

    The first thing which is really pleasant with the Note 9 is that you no longer need the specialised DeX dock, any USB-C dongle with HDMI, USB and Charging will work. I have one which I got a while ago for the VJ-OTG demo so I used that.

    I plugged in a USB charger and mouse and keyboard to the dongle and DeX started straight away! The phone screen still works whilst DeX is running, so you can use it as a secondary screen for Android apps.

    About Linux on DeX

    Linux on Dex is an app for the Note 9 which gives you a Linux container you can access as a full desktop Linux environment on DeX. You can also access a terminal only version on the phone.

    Linux on DeX running in terminal mode on the phone.

    The terminal only mode is a great way to run commands when you are on the move.

    When you run it from the DeX you get full desktop Linux you’d inspect.

    Linux on DeX running desktop mode in DeX

    Linux on DeX is so performant because it’s not running in a virtual machine, it’s a container which takes advantage of the device’s resources. So software written for it needs to be made for the device’s ARM architecture.

    Software

    Linux for ARM devices is widely used because of the popularity of Linux powered SoC ARM devices such as the raspberry pi. As a result there is a lot of linux software compiled for ARM architecture ready to install using APT.

    For example you can install node with:

    sudo apt-get install node-js

    This will prompt you for the root password which is ‘secret’ out the box but you should probably change it.

    For the editor I wanted to use Visual Studio code which is what I like to use on my personal computer. Unfortunately it’s not available for download for ARM architecture from the website. Fortunately because it’s open source software it has been compiled for ARM from https://code.headmelted.com/

    The default script couldn’t install automatically for security reasons so I had to run ‘apt-get install code-oss’ after running the script from the site which added the repos.

    Configuring

    If you’re like me you probably want to configure the Linux desktop to your liking. All the command line tools I like to use such as zsh and tmux. Worked really well. I copied my configuration for these from my personal laptop to the phone and they worked out the box.

    To copy them across I put them on a memory stick and plugged it into the phone. I then moved them into the “Internal storage/LoD_Share/” to make it available on Linux on DeX. I then linked them into the right places.

    zsh is a terminal shell, like bash, which provides nice features for autocompletion. I use oh-my-zsh with the powerlevel9k theme to make it really useful.

    tmux is a tool which lets you tile terminal layouts, and have them in different “windows” so you can run multiple processes from one terminal and easily switch between them. I use a slightly modified version of this set up. Which gives me some really nice functionality when dealing with lots of processes.

    Both zsh and tmux take advantage of powerline fonts which are really handy for making an attractive and useful terminal.

    Configuring the window manager unfortunately was not as easy.

    Linux on DeX uses Gnome 2 out the box. Unfortunately Gnome Tweak Tools doesn’t work on Linux on DeX right now. Gnome Desktop also appears to have some issues wrt changing windows.

    It can be changed to Mate which may be familiar to those of you who use Linux Mint on your laptops. Mate works well and it also can be tweaked. I haven’t looked into using it on Linux on DeX yet but that is probably the route I will take.

    Using

    One really powerful feature of Linux on DeX is that it is runs great alongside the standard DeX experience. It starts extremely quickly, pressing the keys win+return can be used to quickly minimise it and holding the mouse at the bottom of the screen shows the DeX taskbar for taking screenshots and showing notifications.

    The clipboard is shared between both systems allowing you to copy text between Linux and Android desktop.

    DeX gets paused when it’s minimised which is really handy for saving power but not very useful when you want to run a long running task or a web server in Linux and then go do something else. I’m hoping it’s going to be possible to keep it running in the background in the future.

    Graphics

    The Note 9 has loads of RAM and a really powerful CPU, so lots of things were really fast. Unfortunately Linux on DeX cannot yet access the graphics capabilities of the device. Which means that things which would take advantage of this are slow or don’t work at all.

    WebGL and Blender run pretty slow. Especially when comparing WebGL in Samsung Internet on DeX to Chrome in the Linux on DeX container.

    Gamepad

    In a related note, we tested the Gamepad API in Linux on DeX. It seems gamepads were not exposed. They could not be accessed in Linux on DeX but worked great in Samsung Internet for DeX. This article by @diekus and I shows how different controllers get mapped in the browser.

    Debugging Samsung Internet on DeX from Chrome on Linux on DeX

    This is the functionality I was most looking forward to and it works really well, with a small caveat.

    It does require an ADB command on an external laptop to enable it but it lasts until the device is restarted.

    Here are the steps to do it:

    1. Enable USB debugging on the device
    2. Plug in the phone to the laptop with a USB-C cable. I had to use the one which came with the device. My regular USB-C cables didn’t work.
    3. Agree to the prompt on the phone to allow debugging.
    4. On the laptop run, adb tcpip 5555
    5. Plug the phone into DeX, start Linux on Dex, make sure that ADB is installed by running in the Linux on DeX terminal: sudo apt-get install android-tools-adb android-tools-fastboot
    6. To start debugging run, adb connect localhost in the terminal.
    7. Open chrome and browse to chrome://inspect to inspect open browsers.

    It works really well with Samsung Internet running on the small phone screen and debugging it via Linux on DeX. It’s a great experience to do responsive design for both mobile and desktop at the same time on one device!!

    Thanks

    Thank you Daniel Blandford for helping with DeX and Linux on DeX tips!!

Comments are closed, but trackbacks and pingbacks are open.