9 ms·
Transform your Android device into a Linux desktop
- pacifika 3y agoWhen the android version is no longer supported but can run Linux inside it is it still safe to use or subject to the android security problems a legacy version would have?
- jeroenhd 3y agoThe kernel and the passive network services that are part of the Android system will still run (though you can probably kill them on a rooted system). The user mode processes like web browsers will still receive support for as long as the Termux project provides the. With some extra steps (chroots and such) you should be able to use the aarch64 version of Debian or another distro of your choosing instead of relying on Termux. This solution lacks proper hardware acceleration, though. A system such as Samsung Dex would be a much better solution to turning your phone into a desktop, leveraging the years of updates to Android apps instead of hacking Linux applications into Android.
- _ea1k 3y agoI tried this with a Pixel 5. Performance was much better than expected! Even big apps like Intellij were usable for small projects. But the big downfall was memory management. It is really easy to get too close to running out of RAM and have the whole environment spontaneously killed.
- axytol 3y agoYou probably need to look into disabling the Android phantom process killer. I had a similar issue and could not get DEs such as XFCE running for a long time and after the fix it was smooth sailing. There are meanwhile quite a few Google references, the one I used at the time is referenced on this comment in the issuetracker: https://issuetracker.google.com/issues/205156966#comment52 https://issuetracker.google.com/issues/205156966#comment52
- _ea1k 3y agoI think that is what I did. I had pretty good stability for some things, but I was really pushing the limits by trying to run Intellij. I could get some Java code to compile and run, but it would always terminate eventually. Of course, the Pixel 5 only has 8GB of RAM total. It might be a different story on the 7 pro or s23 ultra.
- phh 3y agoFor people who want to go down rabbit holes, you can get very far with this. I ended up with UT2004 [2] (Windows version) running on my smartphone (complete stack was Termux => proot => ubuntu => box 86 => wine => Zink (Android-side, with virglrenderer to pass through to proot-side) => OEM Vulkan driver [1]) I even attempted to make it into a generic ROM, so that you could flash any Android with a Boot2UT2004 ROM, but the Zink part was hard to make generic enough. [1] I mention OEM Vulkan driver, because many people are using Zink over a modified Turnip that works on original OEM kernel [2] I don't even appreciate UT2004, that was to troll a colleague
- stavros 3y agoWait, how do you run Ubuntu on the phone? I'd love an Ubuntu shell on the phone itself.
- snats 3y agoThere are images created specifically for termux. For example the link below is the first that I found. https://github.com/EXALAB/AnLinux-App https://github.com/EXALAB/AnLinux-App
- stavros 3y agoThis looks great, thanks! EDIT: I ended up using UserLAnd, seemed a bit more highly rated, thanks again!
- paraknight 3y agoI highly recommend using Andronix + AVNC
- phh 3y agoSomething like that: pkg install proot proot-distro ; proot-distro install ubuntu ; proot-distro launch ubuntu
- sublinear 3y ago> Setting up a Desktop Environment: We’ll use VNC... Noooo! > if you prefer to set up an XServer, you can find instructions on the Termux Wiki (clicks link) > GraphicalEnvironment There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page. ... bad vibes man
- waithuh 3y agoHave you checked https://archive.org https://archive.org
- moron4hire 3y agoApparently the URL is wrong. There should be an underscore between Graphical and Environment https://wiki.termux.com/wiki/Graphical_Environment https://wiki.termux.com/wiki/Graphical_Environment Also, the x11 setup instruction is wrong. Instead of `pkg install x11-repository` it should be `pkg install x11-repo`. EDIT: and `nano .vnc/.xstartup` should be `nano .vnc/xstartup`. Actually, just skip this big post entirely and follow the instructions in the termux wiki. The information is identical, more complete, but without the errors.
- a-dub 3y agoi've often wondered if my phone could drive large external displays and become a thin client. would be pretty cool!
- DANmode 3y agoConvergent desktop. Manufacturers being, frankly, shit, is the only reason we don't already ubiquitously have this.
- xen2xen1 3y agoAlways thought Microsoft's Continuum would have been the wave of the future at some point had windows phones survived. Just uses your Windows phone as your Windows desktop.
- RajT88 3y agoSamsung Dex is actually pretty flexible in comparison. It's not a terrible desktop environment, and it can "cast" to smart TV's, output via usb > HDMI adapter, or you can plug it into your laptop and bring up the phone desktop environment with the Dex app. I leave my work laptop at home now, and just take my personal laptop and work phone when I am on vacation now. Dex is good enough to get into 70%+ of the cloud tools I might need when remotely working because stuff is burning down.
- _yb2s 3y agoExactly… modern phones are crazy powerful and would work as desktops for 99% of users if they weren’t locked down in software. I have an older $100 iPhone SE2 and it has more cpu power than many new $1k laptops.
- btobolaski 3y agoSpot checking this, I don't see any manufacturers making a $1k laptop in the same ballpark. Closest seems to be Dell trying to sell last gen processors for the same price as current gen and those are at least 2.5x faster. Excluding them, everything else was 3.5x faster with some far exceeding that. That being said, it would probably be enough to service many computing needs and one device is a great deal more convenient than multiple.
- moondev 3y agoAnother way to get a similar experience is by enabling the following options from the android developer menu: * enable freeform windows * force desktop mode on secondary displays * enable non-resizable in multi-window Then choose "simulate secondary displays" and choose the size (720p, 1080p, 4k) Using https://github.com/Genymobile/scrcpy https://github.com/Genymobile/scrcpy from your desktop and connecting to your phone allows you to choose the virtual display to connect to instead of your main phone display with the --display flag. It's similar to a chromeos feel and very performant
- stavros 3y agoI did that, and I got a display on my PC, but... then what? It's just a black window with nothing else.
- loa_in_ 3y agoI believe you have to go to native app switcher and long press the application icon to get more options
- stavros 3y agoHm, nothing, maybe Xiaomi has it somewhere else. Thanks for your help!
- kubafu 3y agoNot sure if it applies to you, but I had the issue with black screen too but finally got it working after issuing the following commands [0] and restarting the device. Hope it helps. [0] https://github.com/nikp123/scrcpy-desktop/blob/main/startscreen.sh#L12 https://github.com/nikp123/scrcpy-desktop/blob/main/startscr...
- stavros 3y agoI'll try that, thank you!
- tysam_and 3y agoHonestly, what I usually use these environments for requires pulling and using someone else's container in some way, or something similar. I have not gone too far in depth, but UserLAnd seems a bit more promising for this, due to how it's structured, if I understand correctly.
- deleted 3y ago[deleted]
- akomtu 3y agoA random idea: android phone as a portable projector. Not sure if the tech allows that, but it would be cool instead of looking at the small screen, get it projected with a tiny LED onto a wall in a dark room.
- 0y 3y agoI remember the Galaxy Beam having this
- Turskarama 3y agoThat's not how projectors work, you can't just beam from an LED screen onto a surface for two main reasons: 1) an LED screen emits light in all directions (which is why you can see it from the side), it would need to emit light only at the screen. Making this work would require putting a microlens over every single individual pixel. 2) Even if you achieved the first step, the amount of light you have will be the same. Spreading the light from a phone screen over an area of several square meters is going to be extremely dim, even if your surface was magically 100% reflective and your room was very dark. Most projectors use lasers, and in the process of generating enough light also generate an absolute ton of heat. It's one of the main reasons even portable projectors are the size they are, it's just about impossible to cool them if they're any smaller. The Samsung beam had dedicated hardware, was quite chunky to fit said hardware, and the projector could only be used in a pitch black room.
- tnel 3y agoThey literally did this 7 years ago with the Motorola Z series and the insta share projector mod. You can get the phone and the projector real cheap used. Pair it with some SoundCore minis paired together and you have yourself a portable movie theater.
- Turskarama 3y agoThat is a micro projector that attaches to the phone, less of a mod and more of a specialised piece of hardware. It was also 50 lumens where a typical home theatre projector is more like 2000 lumens. There's a reason most people own a tv and almost nobody owns a micro projector, they're not very good.
- stavros 3y agoIs it possible to connect this to an external display via USB to HDMI, or is it VNC-only? I'd love to have an Ubuntu desktop in my pocket, to use in a pinch.
- worthless-trash 3y agoIf you use sumsung dex and run a vnc client to itself, that would work.
- stevefan1999 3y agoUnfortunately this comes with a limit. Termux, by extension proot, is using strace to modify syscall to rewrite UID and GID as root and root. Think Usernetes and fakeroot for a moment. The immediate side effect is some applications like Cargo build will sometimes fail to build artifacts randomly, and you still can't access dmesg and most of the procfs. You also won't have Mesa 3D acceleration on Termux too. I would also suggest replacing VNC with X11 forwarding since it should be faster and we can technically use UDS. You will also need to disable the phantom process killer in Android 12 if you want to run something practical. I ran vscode remote because Jetbrains Gateway failed to run on Termux
- _shantaram 3y agoJust dropping in to second VSCode remote (assuming you meant code-server). My T480's display shot itself and I put Termux+code-server on a tablet I had lying around. Aside from the cramped Bluetooth keyboard, I had my full editing experience (even the embedded terminal in VSCode worked). Really stunning how far mobile work has come. (I'm on a ThinkPad E14 now though. Missed the trackpoint too much :3)
- stevefan1999 3y ago> Just dropping in to second VSCode remote (assuming you meant code-server). Yes and no. It is the native VSCode remote server (a closed source Microsoft version using SSH: https://code.visualstudio.com/docs/remote/ssh https://code.visualstudio.com/docs/remote/ssh), but it is also called code-server, which is often confused with coder's code-server (https://github.com/coder/code-server https://github.com/coder/code-server)
- stevefan1999 3y agoFor anyone looking to disable the phantom process killer check this out: https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md#commands-to-disable-phantom-process-killing-and-tldr https://github.com/agnostic-apollo/Android-Docs/blob/master/...
- Beached 3y ago
- takantri 3y agoAs an alternative to the VNC method suggested here, there's also the Termux-X11 add-on[1]. In my experience, VNC is more stable, but when Termux-X11 works, it feels snappier than VNC, and the resolution of the Linux environment is automatically scaled to the available screen space you have (making portrait/landscape switches and soft keyboards feel seamless) [1] - https://github.com/termux/termux-x11 https://github.com/termux/termux-x11
- tetris11 3y agoHow do you get X11 to work though. Don't you need an X11 server running on top of the existing Android display server?
- MayeulC 3y agoBah, just an X server (or minimal reimplementation) running in an app, that then renders to its top-level surface. What I would really like to see is an Android back end implementation for wlroots. Or alternatively, a small Android(/termux) app that just acts as a simple Wayland compositor, that compositors can then use as a back-end. I found an issue about this some time ago, but can't find it anymore.
- rodoxcasta 3y agoIs someone using some old phone, but with a recompiled kernel, to support standard linux features, like docker? It's possible in theory, but still didn't found someone doing it. Seems that running docker in an old android repurposed as a server is still too much niche, unfortunately. Bonus if it can run KVM with hardware support, but I don't know if it's possible yet.
- tetris11 3y agoPostmarketOS does exactly what you're saying
- quechimba 3y agoMy laptop died due to high humidity in the Amazon rainforest and I had some work to do, so I bought a USB keyboard and installed zsh, tmux, vim, ruby, node and postgres in Termux and worked on my phone. The screen is too small but I could get things done. Sometimes I borrowed my brothers laptop and logged in to my phone over ssh to work.
- 4oo4 3y agoI just learned recently that termux is almost unmaintained and hasn't had a new release since 2018 (packages are still updated though). I'm hoping someone steps in soon (since I lack android Dev skills) since I can't imagine my phone without it. This is awesome, I thought about installing a full DE in it before but got lazy.
- KingMachiavelli 3y agoThere's termux-monet (https://github.com/HardcodedCat/termux-monet https://github.com/HardcodedCat/termux-monet) which is actively maintained and has quite a few UI improvements since it forked from termux.
- 4oo4 3y agoIs there a good summary somewhere of what all changed in the fork besides Monet theming?
- worthless-trash 3y agohttps://github.com/termux/termux-app/compare/master...HardcodedCat:termux-monet:master https://github.com/termux/termux-app/compare/master...Hardco...
- tetris11 3y agoThat was incredibly unhelpful
- worthless-trash 3y agoI thought HN was capable enough to read a techical difference between commits, HN must be getting less technical these days.
- grognardo 3y ago>hasn't had a new release since 2018 are you referring to something other than the releases at https://github.com/termux/termux-app/releases https://github.com/termux/termux-app/releases ?
- j45 3y agoIs postmarketos of interest or used by anyone?
- Espionage724 3y agoFor me, not until it gets VoLTE: https://gitlab.com/postmarketOS/pmaports/-/issues/1878 https://gitlab.com/postmarketOS/pmaports/-/issues/1878
- lampshades 3y agoWould it make sense to buy an Android tablet with their "Magic Keyboard" and use it as a Linux device? What limitations would I run into? Let's say I want to create apps using Android Studio.
- imbusy111 3y agoI used Samsung DEX (Galaxy Fold 3) as my desktop for work for a few months. It had some minor issues, but otherwise works surprisingly well and I was able to develop Python applications, run web servers, etc. Plus, it's only using a couple of watts instead if hundreds of watts compared to a 5 year old desktop for the same performance.
- tooltalk 3y agoI've using mine (S22+) as my daily driver (8hr/day) for about 6 months after my Dell XPS 13 stopped working mysteriously. I was about to get a new laptop, but found that DEX works amazingly well with my 4K 32" monitor! It's a pretty good thin client and does almost 80+% of what I normally do on desktop. It's fine for web browsing, but I use replit and codespace for small python/rust/c projects.
- esperent 3y agoI tried using Dex for about two weeks on my S21 FE while my laptop was in for warranty repairs. It was extremely frustrating and next time I'll find a laptop to borrow instead. The hardware can handle it. The problem is the software, so many tiny issues like not being about to drag and drop, bad window management, lack of shortcuts and lots more added up to an unacceptable experience for me. But it did give me hope that in the future, maybe not my next pc, but the one after, might be the size of a phone.
- 4RealFreedom 3y agoI was impressed the first time I used DEX. I thought smartphones would move into laptop replacements organically.
- EVa5I7bHFq9mnYK 3y agoCan this thing + VSC+galaxy fold+external keyboard+mouse replace my laptop for coding while on the road?
- Espionage724 3y agoA cooler use for this is with Meta Quest VR headsets. Pair a keyboard and mouse to it, side-load productivity apps and you have literal floating freeform windows that only you can see (wider customization availability and privacy). Termux should work perfectly word-for-word from that guide on Quest 2. My favorite distro also has similar notes: https://fedoramagazine.org/how-to-install-and-update-fedora-linux-on-android-using-termux/ https://fedoramagazine.org/how-to-install-and-update-fedora-...
- circuit10 3y agoI wish it supported this kind of use case better, but they seem to not like it. For example whenever you go to load a sideloaded app you have to go to a different section of the menu and it has a patronising warning about how piracy is against their terms of service that you can’t get rid of. There are also unnecessary restrictions on window placement that didn’t exist on the Oculus Rift. Also in the base Quest 2 at least you can’t run a VR application with a floating window on top of it
- Espionage724 3y agoA Quest 2 wouldn't have the power to run a VR app and floating window; it has a hard enough time trying to run a browser and flat game just from Home with virtual environment: https://www.youtube.com/watch?v=BPmphsTu0U4 https://www.youtube.com/watch?v=BPmphsTu0U4
- circuit10 3y agoI’ve heard Discord pings in the background when playing a game so that implies to me that the browser is still running but hidden, so it seems to be possible. I could be wrong here, maybe it did that some other way, but even then it’s probably possible to improve the situation by letting VR games mark themselves as lightweight enough to not need all the hardware or something like that
- pjmlp 3y agoThe reason why it is no longer available from Play Store is that it won't abide by the security rules of public/private Android APIs, so it has to be manually worked around. Also since Linux APIs aren't part of stable userspace guarantees for the NDK, and bionic isn't GNU libc, there is room for plenty of surprises when trying to pretend Android/Linux is just like GNU/Linux. https://github.com/termux/termux-app https://github.com/termux/termux-app > NOTICE: Termux may be unstable on Android 12+. Android OS will kill any (phantom) processes greater than 32 (limit is for all apps combined) and also kill any processes using excessive CPU. You may get [Process completed (signal 9) - press Enter] message in the terminal without actually exiting the shell process yourself. Check the related issue #2366, issue tracker, phantom cached and empty processes docs and this TLDR comment on how to disable trimming of phantom and excessive cpu usage processes. A proper docs page will be added later. An option to disable the killing should be available in Android 12L or 13, so upgrade at your own risk if you are on Android 11, specially if you are not rooted.
- chromoblob 3y agoI want someone to make an Android app which runs Userspace Linux, possibly with a way to configure the kernel and/or add patches. You could then run any Linux distributions and programs compiled for the device's processor arch.
- SushiHippie 3y agoThere is also https://andronix.app/ https://andronix.app/ which lets you install a full Linux distro in termux.
- dspillett 3y ago> is very straightforward This must be some strange use of the word “straightforward” of which I was previously unaware! There is no rocket science in there, such that a sufficiently focused non-techie could do it, but I think this comes under the same umbellar as “just stop saying just” and “don't describe everything that you are do as simply”.
- teleforce 3y agoJust a thought. If Microsoft can provide WSL2 that enables Linux seamlessly running alongside Windows (native speed with hypervisor), why can't Google or Android community provide the same functionality? With numerous and pervasive existing Android installations on phone, tablet, etc, perhaps then we can finally claim the elusive "The Year of Linux on the Desktop" title.
- No-Firefighter 3y agoOne thing I found particularly useful was the caution about potential compatibility issues and the emphasis on creating backups before attempting the installation. This demonstrates a responsible approach to tinkering with one's device and ensures that readers are well-prepared for any potential hiccups along the way.
- guggle 3y agoAnyone tried to use a phone as a low power web server ?
- DoctorOetker 3y agoFor each major brand of cell phone: where can one find (possibly encrypted) full ROMs and the public keys in eFuse or software to read this out? Instead of emulating a Linux desktop on top of Android, I think many would prefer running Linux natively. Yes that would require driver support. Indeed nobody would waste their time developing drivers if one can not even test them without being able to sign with the private key corresponding the eFuse / silicon ROM public keys. A benevolent but for sake of argument hypothetical cryptographer that can solve widely used mathematical challenges, might desire to liberate the human population. A declaration of computational independence. Those who look forward to liberty of computation, may collect and assemble a publically accessible database of ROM's public keys, etc. and may encourage said hypothetical cryptographer to risk a single round release of the corresponding private keys.
- butz 3y agoHow about actually installing Linux desktop, and not running outdated and insecure layer of Android under it? PostmarketOS probably would be best choice. Are there any other alternatives?