Your Linux desktop is frozen, but your work isn’t lost—here’s how to save it


Even when a Linux desktop appears frozen, most of the time, the operating system is running just fine. The graphical interface is just another program that runs on top of the Linux system, so even if it crashes, you can restore your desktop session. That way you can back up your unsaved work and get back to your desktop without rebooting. Let me show you how to do that.

What is a TTY session, and when to use it

This text-based console is another way to interact with your Linux machine

Linux systems have special text-based console interfaces called TTYs or Teletypewriters. This console lets you interact with the system just like you would with a terminal app. It runs separately from the graphical user interface, so even if the GUI crashes, you can still save your unsaved work or kill offending processes.

The most common unrecoverable scenario is a kernel panic, which means the system running underneath the graphical interface also crashed. You won’t even be able to access the TTY console when that happens.

You only need to jump into the TTY console if the entire desktop is unresponsive. If it’s just one program window that’s frozen, you can kill it with the xkill command. Open the terminal app and enter the following command.

xkillYour cursor will turn into a cross and whichever window you click will be instantly terminated.

The xkill command lets you kill a process with a single click.

In any case, launching a terminal should be your first step. If you can access a terminal, you can use it to look up active processes with a tool like htop or btop. With htop or btop, you can directly kill problematic processes.

Jumping into a TTY session

Use the keyboard shortcut Ctrl+Alt+F2 and login with your usual credentials

Let’s say your computer is completely frozen, and you cannot even open a terminal window. The first step is to press Ctrl+Alt+F2. This shortcut will drop you into a new TTY session. You’ll need to log into your Linux system with a username and password (it’s the same username and password you used to log into your current desktop session.)

First type in the username, then the password. The password input will be invisible; just press Enter when you’re done typing.

Once you’re dropped into the TTY session, run htop or btop to view the processes consuming the most RAM and CPU. Look for apps that are consuming too many resources.

If you don’t have any important work to save, you can just kill all the offending processes. On htop, you can select the offending process using arrow keys and hit F9. Select SIGKILL from the list to instantly terminate the process.

You can also use the killall command, if you already know the target process.

killall firefox

Saving your work just to be safe

You can back up autosave files and monitor active jobs

Even if you’re not ready to kill an active process because you’re worried about losing unsaved work, you can use the shell to save the work before jumping back in. Some apps autosave your work, but just to make sure, you can save that autosave data somewhere safe. For instance, LibreOffice keeps autosave files in this directory ~/.config/libreoffice/4/user/backup/. You’ll find VS Code autosave data in this location ~/.config/Code/User/workspaceStorage/ If you have a command running in the terminal, you can check if it’s still alive with this command. Substitute name with the name of your target process.

ps aux | grep name

If it’s running, you’ll see at least two lines in the output.

Two lines of output indicate a running process.

For example, if you’re trying to render a video with Kden Live or DaVinci Resolve, you can use ps aux | grep kdenlive to see if it’s still running. If KdenLive is still active, you could monitor the output (the output is rendered incrementally, so the file size keeps growing.) With this command, you can monitor the file for changes. If its size keeps growing, that means the render is still running just fine.

watch -n 2 ls -lh /path/to/output.mp4

Jumping back into the desktop session

Check if the graphical desktop session was restored

Once you’ve identified and killed the bad processes, your desktop session should be restored. You can check its current status by jumping back into the current desktop session.

i3 environment running Qutebrowser.

Most Ubuntu and Fedora-based systems will take you back to the graphical desktop session if you press Ctrl+Alt+F2 again. Some systems (like MX Linux, which I’m using) use Ctrl+Alt+F7 to return to the current desktop session.

If neither of those shortcuts take you back to the active desktop session, consider cycling through the entire function row, from F1 to F9.


It’s possible to recover a frozen desktop session in most cases

If all goes well, you should have a working desktop again, complete with your running apps, except for the ones you manually terminated. It may take a second for the switch to complete, especially on older hardware, so give it a few seconds even if the graphical interface still appears frozen.



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


Serials have become the backbone of the streaming era, especially on Netflix. Serialized television is when a show’s plot unfolds in sequential order over the course of a season. It’s long-form storytelling that typically works best with dramas—Stranger Things, The Crown, etc. Watching the episodes in release order matters. Often, these shows are binged because the complex character arcs and cliffhangers encourage streaming multiple episodes at once.

Serial shows can feel like homework, especially when you fall behind on an episode and need to catch up. That always happens to me, and it leads to anxiety I didn’t want. Thankfully, Netflix offers shows where viewers can jump at any time and not feel lost. These episodic series are perfect for jumping around and picking the episodes you want to watch. One of the most famous comedies ever fits the criteria of an episodic sitcom. Anthology shows, including a Netflix sci-fi classic, are also ideal for watching episodes out of order.

Black Mirror

Welcome to your worst nightmare

Black Mirror wants to scare you. Charlie Brooker’s sci-fi anthology series has been warning humanity about the dangers of technology since 2011. It seems like ages ago that Rory Kinnear had sexual intercourse with a pig in the first episode. Apologies for the spoiler, but the media’s role in the spread of misinformation has never been more relevant.

Black Mirror features self-contained episodes with a beginning, middle, and an end. There has only been one direct sequel: USS Callister: Into Infinity, a season 7 episode that continues the events of season 4’s USS Callister. Otherwise, feel free to jump around and check out the best episodes of each season. Since most episodes feature bleak endings, I’ll leave you with one that ends on an upbeat note: San Junipero.

Seinfeld

Greatest comedy ever?

Comedies are the perfect vehicle for episodic storytelling. While having an overarching plot throughout a season helps attract viewers, many comedy fans are just looking for a few laughs. Write a self-contained story with numerous jokes over 20 to 30 minutes, and you’re ready to go. Seinfeld, aka the show about nothing, is the ideal escape from serialized dramas.

Seinfeld stars Jerry Seinfeld as a fictionalized version of himself as he navigates the comedic scene in New York City. The show revolves around Jerry’s interactions with his friends George (Jason Alexander), Elaine (Julia Louis-Dreyfus), and Kramer (Michael Richards). The gang faces a problem, hilarity ensues, and the episode ends. That’s really all you need to know. Enjoy the laughs.

Guillermo del Toro’s Cabinet of Curiosities

The genre maestro curates new horror stories

There’s a reason why Guillermo del Toro is considered the “King of the Monsters.” The genre expert is as elite as it comes when dealing with mythology and creating new worlds. The Oscar winner relied on his horror expertise in the anthology series Guillermo del Toro’s Cabinet of Curiosities.

I hate referring to episodes of television as “mini-movies.” However, that’s how I would describe the eight episodes of Cabinet of Curiosities. Each director puts their own signature style on a story and brings audiences into their terrifying creation. Del Toro wrote two of the episodes, including one about a demon being summoned. Some are scarier than others, but horror fans will feel right at home with this series. ​​​​​​​

Beat Bobby Flay

Bobby brings the heat

As I’ve gotten older, the Food Network has become one of my favorite channels. I mean, who doesn’t love food? I love eating my (average) home-cooked meal while watching contestants duke it out in the kitchen on my favorite show, Beat Bobby Flay. The competition breaks down into two rounds. In the first round, two chefs have 20 minutes to construct a meal using a secret ingredient. The winner advances to the main event, where they face off against Bobby Flay.

The challenger gets to pick the dish for the final round, so Bobby has a disadvantage. However, Bobby is an award-winning chef with a few tricks up his sleeves. He can handle making a version of your grandmother’s lasagna. With episodes available on Netflix, be prepared to learn why Bobby always throws chiles into his dishes.​​​​​​​

S.W.A.T.

Broadcast TV still knows how to make entertaining programs

The procedural is a genre best produced on broadcast television. Name a cop, doctor, or law drama—chances are it’s a procedural on broadcast TV. While the way we watch television has changed, people still love these types of shows on CBS, NBC, Fox, and ABC. Law & Order, NCIS, and Criminal Minds are procedurals that gained a bigger following thanks to streaming.

S.W.A.T. is cut from the same cloth as Chicago P.D. and CSI. Sergeant Daniel “Hondo” Harrelson (Shemar Moore) is tasked with leading a new S.W.A.T. unit in the LAPD. This action-packed show utilizes a “case of the week” formula in which the team must solve a dangerous situation, such as active shooters and hostage situations. You’re in and out in 44 minutes. What’s better than that?​​​​​​​


Netflix has more content coming your way

After you’re done watching these shows, stay on Netflix for more top-notch content. Netflix has an entire section dedicated to thrillers, and this week, The Guilty and El Camino are two of the section’s best. Keep an eye out for new movies, like Alan Ritchson’s War Machine, which is currently in the streamer’s top 10.

Subscription with ads

Yes, $8/month

Simultaneous streams

Two or four




Source link