Summary
- Installing the OS comes last in PC-building. Flash ISO to USB for Linux. Can run Linux on live USB before storage drive install.
- Alpine Linux and Ubuntu run from RAM is possible. Easy setup command.
- Running OS from RAM is fast, but apps are gone post-reboot. Not ideal for most users, better SSD option for PC responsiveness.
Installing the operating system is always the last step in the PC-assembling process. The most common method involves flashing the ISO file of your favorite OS on a USB drive and using it to install the operating system on a storage drive.
For those well-versed with Linux distros, you might be aware that it’s possible to run the OS on a live USB before actually installing it on your drive. However, if your system has enough memory, you can even boot certain operating systems from the RAM modules. I recently tried doing so on Alpine Linux and Ubuntu, and here’s my log of the entire process.
How to dual-boot Windows 11 and Linux on your PC
If you want to use Windows 11 and Linux on the same computer, the best option may be to dual boot. Here's how to set up your PC for it.
Alpine Linux was my first choice for the project
Though there wasn't a lot I could test in a command-line OS
Before I dipped my toes in Ubuntu, I wanted to try running a CLI-based OS on the RAM. Alpine Linux seemed like a good place to start, as it’s fairly lightweight, and you can calibrate it to work in a diskless environment.
Once I’d booted from a USB drive containing the (flashed) ISO for Alpine Linux, I ran the setup-alpine command to begin installing the OS. After picking the keyboard layout, hostname, network, and apk mirror settings, Alpine Linux displayed the option to pick the storage drive for the operating system. Since I was aiming for a diskless setup, I typed none for the disk, config storage, and apk cache directory locations. Soon, the OS was loaded into the RAM, and I was free to unplug the boot drive.
With that, I began tinkering with a few packages and even tried to install the Gnome desktop environment. However, loading into Gnome required me to reboot the system and, since I was running everything from the RAM, the data would get flushed the moment I restarted the PC. Regardless, my success with Alpine Linux drove me to attempt the same thing on a full-fledged GUI OS, namely Ubuntu.
Configuring Ubuntu to run from the memory was pretty easy
All I had to do was modify a boot command
Once I’d decided to run Ubuntu on the RAM, I had to deal with the issue of memory capacity. While I could technically run the live version of the most popular Linux distro from my 16GB of DDR4 memory, I figured it would be impossible to run my favorite apps without buying more RAM sticks.
But since I had a 64GB Xeon server PC lying around, I decided to switch my rigs mid-project. Once I’d flashed Ubuntu 24.04 on my trusty USB stick, I plugged it into my LGA 2011-3 motherboard and waited for the GRUB bootloader to initialize.
On the GRUB screen, I hovered over the Try or Install Ubuntu and pressed e to edit the boot commands. I moved the pointer after the quiet splash argument and added the toram parameter before pressing F10 to launch Ubuntu with the newly edited boot command. After waiting for what felt like an eternity on the Ubuntu splash screen, the OS finally booted from the RAM.
Before I started messing around with the packages, I unplugged my USB drive to remove anything resembling permanent storage from the system. I also wanted to check the base memory consumption without anything else installed. According to the System Monitor, Ubuntu consumed roughly 9.1GB out of 67.5GB (or, in layman’s metrics, 64GB of memory), meaning there was a lot of headroom to install more apps.
How far can you go on an OS booted from the RAM?
Surprisingly, quite far, assuming you have ample memory
Speed-wise, running the live version of Ubuntu from the RAM felt significantly more responsive than your average USB 3.0 drive. However, I found the responsiveness to be comparable (or in some cases, slightly higher) than that of my NVMe SSDs. As for the tests, booting up multiple Firefox tabs didn’t push the memory consumption past the 11GB mark, and neither did running other default apps on Ubuntu.
So, I used the built-in App Center to install Inkscape, Krita, and a few other applications. Since the PC wasn’t lacking in core count or memory, there weren’t any issues running all the apps simultaneously. As such, the next logical course of action was to run games with the help of Steam.
After installing the Steam client and signing in to my account, I installed lightweight games such as Terraria and Starbound. By now, the memory cache was starting to build up and the memory consumption had crossed the 24GB mark. The System Monitor had also crashed a couple of times, with Ubuntu displaying a handful of crash messages.
Since the RAM-laden PC crushed everything I threw at it, I decided to run one final test before calling it a day: installing (and running) the 19.2GB package for 7 Days to Die. Installing the game pushed the memory consumption up to a whopping 36GB, which was over 50% of my total RAM. Although I didn’t encounter any issues besides some weird glitches in the System Monitor, 7 Days to Die was permanently stuck on the initializing screen. Although I wasn’t very impressed with the responsiveness of the OS, I was satisfied knowing that the project was still a success.
Should you run an OS from the RAM?
If you’re a regular Joe who wants a snappier Linux experience, I wouldn’t recommend this project. Its major drawback is that any files, apps, or documents you set up on the RAM will get deleted the next time you reboot the PC, and setting up persistent storage can be quite cumbersome. Moreover, memory-starved systems will run into instability issues the moment you boot into the OS. Setting up swap storage wouldn’t be pragmatic, because the constant reads and writes could shorten an SSD’s lifespan. And if you’re already using an SSD for the swap storage, there’s no reason not to install the distro on the drive instead of the RAM.
10 best operating systems for Raspberry Pi 5
Unsure about which OS you should use with your Raspberry Pi 5? Here are ten operating systems worth running on the palm-sized system
However, there are still a few cases where it’s better to run an OS from the memory. If you want to thoroughly test the OS without the slow speeds of a bootable USB, it might be a good idea to load the live version of the operating system into the memory first. Likewise, for those who work with highly classified and sensitive information, this project could be of some use. But for everyone else, using an SSD (preferably an NVMe drive) is simply the optimal way to increase the responsiveness of your PC.
