Another 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 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
I just plugged a USB-C docking station, and I can almost use the smartphone as a standalone computer, if it wasn't for the very low resolution that Android decided to use for the external monitor. It does not look like this is configurable on Android, isn't it? Has anyone tried this kind of setup?
>if it wasn't for the very low resolution that Android decided to use for the external monitor. It does not look like this is configurable on Android, isn't it? Has anyone tried this kind of setup?
I guess it depends on your docking station, phone, and what SoC and video output chip it has and less on the Android build.
I plugged my OnePlus 7T running Android 12, in my 4k monitor via a USB-C to DisplayPort cable and the monitor reports 4k@60Hz resolution, and the phone is from 2019, so high resolution is definitely possible and frankly that's pretty amazing that this feature exists and it works this well (suck it iPhone :p)
AFAIK, other android phones, like Pixels, don't have DisplayPort via USB-C output capability or might be limited to lower resolutions. What phone do you have? Try plugging to DisplayPort directly without the dock.
> AFAIK, other android phones, like Pixels, don't have DisplayPort via USB-C output capability or might be limited to lower resolutions. What phone do you have? Try plugging to DisplayPort directly without the dock.
Fairphone 4, which should support DP over USB-C, but I do not have a USB-C to DP cable at the moment to try. Thanks for your suggestion :)
Not 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.
For 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
The 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.
> 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.
Unfortunately 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
Just 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)
these reasons, and not having full control over hardware are why I haven't been able to make this work for me.
I wish there was a better ecosystem for Linux phones that do give you true root and full control over your phone, os, and hardware
You actually have 80% of the control of your phone after rooting it. The remaining 20% is due to kernel variation and not having all mainline features. Most Android distributions are tailor-made Linux kernel that is very old and is stitched by cherrypicking some mainline commits.
If you want full control check out postmarketOS: https://postmarketos.org/. With the right hardware and software you can even run Kubernetes on it (I'm planning on running such cluster)
I 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.
You 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.
I 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.
As 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)
Bah, 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.
I 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.
Termux is not updated through play store anymore. Only through github and fdroid. The one on play store is discontinued.
The last stable release was in June 2022. It's still being developed and getting ready for 119. You can get the ci builds from GitHub. There's multiple daily.
Whoops, that's completely inaccurate. I think I had misread the last updated in F-Droid when I installed it on my new phone. That does have the v0.118.0 like the repo does. So you are totally right, thanks for the correction! I'm glad it's not as bad as I originally thought.
A 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.
I 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
A 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
I’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
My 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.
I 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.
I'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.
I 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.
For 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.
Is 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.
> 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.
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.
Would 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.
How 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?
One 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.
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”.
I 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.
A 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.
That'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.
You can technically use any display as a projector. You just need to put a huge lens in front of it that is capable of collecting all the light that is being emitted in all directions and focusing it onto the surface. No, it won't be practical, and it definitely won't be bright. But you can use that method to project slides (remember those?) onto a wall by putting them in front of a torch and using a magnifying glass.
They 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.
There are also Xperia Touch(G1109) and numerous other AliExpress projectors with Android device integrated. The idea is potentially valid but IME the lamp tech available are just too dim.
When 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?
The 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.
Is 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.
Samsung, Huawei, LG (well, they exited the phone biz) and Motorola all have a desktop mode on many of their Android devices. You plug in a USB-HDMI adapter (I've plugged in a ton of USBC docks to my phone and they just work most of the time), a keyboard and mouse and you have an Android desktop. It's not terrible, and I've used it in a pinch when I don't have my laptop and have work to do.
There's also a way to turn on the desktop mode in developer settings, but I've never tried it in anger.
Exactly… 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.
Spot 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.
Which is impressive, and even more deeply embarrassing for Microsoft, Google, Dell, Asus, Acer, and everyone else who calls themselves a computer or phone manufactur.
Hard to blame Apple, due to their market entry-point always being late.
Always 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.
Samsung 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.
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.
Using 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