Enable x11 Forwarding With SSH (Remotely Use GUI Applications)

In the last article, I explained how to enable SSH. In today’s article, we’re going to learn how to forward GUI application windows with SSH. x11 forwarding is easy and beneficial. Once you learn how, you may decide to stop using VNC or TeamViewer.

Just to quickly clear up a misconception, x11 forwarding works just fine with Wayland. Way back in the earliest days of Wayland development, it was agreed that it should retain backwards compatibility with x11 forwarding.

What is this strange thing, this x11 forwarding?

Well, when you’re connected to another computer via SSH you can use the terminal to control the computer. That’s great, but what if you want to use a GUI application? Sure, you could set up some sort of remote desktop application, such as VNC. Or, alternatively, and often more simply, you can just forward graphic applications over SSH. It’s remarkably easy!

Perhaps a picture is in order. Check this:

gedit in action
That’s GEdit running on a different computer, but forwarded to this one. Pretty neat, huh?

That’s right. That’s GEdit running on my laptop. I’ve just forwarded the GUI application to this computer. If I write something and save it, it’d be saved on the computer that I’m connected to and not the computer that I’m using.

Amusingly, I used this exact process just recently. I had to move a complex password to my laptop and I was being lazy. So, I opened GEdit remotely and pasted in my password, transferring my new password to the other device. See? It comes in handier than you might think.

Let’s Enable x11 Forwarding:

How do you do this? Well, first you need to crack open your terminal. To do that, you just press CTRL + ALT + T on your keyboard and your default terminal emulator should open.

Now, in said terminal, you need to run the following command:

Once you have that file opened with nano, you just need to remove the appropriate pound sign (“uncomment” it out) for the right line. Look for the line that says:

And change it to:

Then save the file with nano by pressing CTRL + X, then Y, and then ENTER. (You may want to learn that, as that’s how you save files in nano.)

Next up, you’ll restart the SSH service and be done with it:

And that’s it! You can now use x11 forwarding over SSH. To do so, you just need to add the -X switch. That’s not as complicated as you might think. Nothing in this article is all that difficult.

To try to make sense of that above command, if I were to remotely connect to the MSI laptop, then my command would look just like:

You can also use the IP address, instead of the hostname, just like we discussed in the previous article about SSH. To do that, it looks like this:

x11 Forwarding in Action:

Once you’re there, just go ahead and start an application. For example, open gedit by typing just that into the terminal. You may find some applications won’t work, often due to ownership and permissions issues, but you’ll find many that work just fine. If you find one that doesn’t work, you can always check any errors thrown and go from there.

Firefox forwarded over SSH
See? Note the carefully drawn arrow that shows where it was forwarded from. Tada!

That’s an example of Firefox forwarded over SSH using x11 forwarding and you may notice the washed out look. I haven’t really dug into it, but I am reasonably confident that washed out look is because of compression. I’ve never needed to dig into that and, amazingly enough, I don’t know everything.

Conclusion:

Anyhow, there you have it. One more article in the books and one more bit of knowledge plastered across the internet. Thanks for reading! If you want to help, you can donate, you can share the site on social media, you can vote to show what type of articles you enjoy, and sign up for the newsletter. You can even buy inexpensive hosting and start your own site while supporting this site or write your own article!

Install SSH to Remotely Control Your Linux Computers

If this article’s headline looks vaguely familiar, it’s probably because I previously wrote an article that told you how to install SSH. That article was on the earlier site. This article will show you how to install SSH, so that you can remotely control your Linux computers.

The old site, while up, will redirect to this address. It’s also a bit of a misnomer. We’ll be installing ‘OpenSSH‘ and enabling SSH. SSH is the protocol, OpenSSH is the application, specifically the ‘openssh-server’.

Let’s say your computer is in another room, in another state, over in another country, or perhaps on another continent entirely. How are you going to manage it? Servers are scattered across the world and it is not even remotely economical to send a person to administer each one of them in person. You’ll need to manage these devices remotely.

One of the best tools for this job is SSH.

As a home-use note; SSH is perfectly suitable to manage my own router. It’s quick, easy, lightweight, effective, doesn’t require an attached monitor, and more. What’s not to like? I SSH into my computers all the time! In fact, right this minute I’m connected to two other computers via SSH!

SSH has been around since 1995 and it lets you issue commands on a remote computer. In fact, the man page describes it like this:

ssh — OpenSSH remote login client

Which, as you can guess, means it lets you login to remote computers so that you can control them. It’s a pretty handy tool to have in your toolbox and it’s actually simple to install.

Install SSH:

SSH is really the protocol, and you can do many things over it. OpenSSH is the application that we’ll really be installing. Once that’s installed, you can login to the computer remotely and manage it that way. I use it quite often.

My homemade router doesn’t have a keyboard attached. It doesn’t even have a monitor attached. It’s not like I can just easily walk over and deal with it. I just got a laptop that, and it’s only used to test Lubuntu. I don’t always want to have to go over to the device and physically use it to start the test.

There’s also my dedicated server in Las Vegas – and I live in Maine. It wouldn’t be practical to fly out to Vegas every few days to run updates on the server. It wouldn’t make financial sense to go out there every time the server needed to be rebooted!

Those are all situations where you can use SSH. It’s available in pretty much every default repository out there. I’m surprised more people don’t use it. To get started, you just open your terminal (press CTRL + ALT + T on your keyboard) and enter the following:

If you’re using a distro with apt:

If you’re using a distro with yum:

Simply adjust that for your distro. For example, in OpenSUSE you may have installed it during the OS installation process. If it wasn’t installed during the initial OS installation then it’s just called ‘openssh’ – if you want to install a few of the applications surrounding openssh. You can also do a ‘sudo zypper install openssh-server’ like the rest of us.

Anyhow, once you’ve installed it, you may not even need to start it. If you install it on Ubuntu, you can go right ahead and test it immediately. If your distro requires that you start it manually, you should do that.

Once you’re done, you can test it easily enough. Try this:

If that works, you’ve properly installed openssh-server and can now make use of SSH. You may also need to enable it in  your firewall. Chances are that your firewall knows what SSH is.

To connect to your device from a remote computer, you’d do:

You can use a specific username in that command, like demonstrated in the testing command just above this command. It’s not mandatory, but doing so will skip a step.

Closure:

You can expect a couple more SSH articles, as this is woefully incomplete. A lot more can be done with SSH, plus SSH should be properly secured. For most of you, behind a NATed router, you don’t really have to worry too much unless you enable port forwarding. If you’re making the port available to the world-wide-web, you’re definitely going to need to add some security. Otherwise, there are a few nifty things you can do once SSH is enabled. We’ll cover those in future articles.

You can also connect with your hostname – probably. In many instances, you’d do this (distro-dependent):

For example, to connect to my testing laptop, I use the following command:

Go ahead and play around with it. There’s a number of ways to help secure SSH and we’ll go over some of that in a future article. I’ve been maintaining the ‘article every two days’ thing for a while now. I see no reason to expect that to not continue.

Y’all have been chewing through bandwidth, so if you’d like to donate that’d be awesome. There are also ads that you can unblock. It’s very much against Google’s rules to ask people to click on them, but I can ask you to unblock them!

You can also register to help, write an article of your own, leave comments, vote on articles, sign up for the newsletter below, or even help support the site by buying inexpensive hosting. Equally important, please share these articles on social media! The more traffic, the happier I am – even if I’ve gotta pay for it myself! Until next time…

Repair Your Linux Boot Process With ‘Boot-Repair’

META: Over the past few days, the site has kinda blown up. The bandwidth allotment was shattered for the month of May – in just the last few days of the month, meaning I had to upgrade my hosting account. 

Whichever of you visitors it is that has been sharing this site’s articles on Facebook and Twitter, I do appreciate it and I hope you continue doing so. The additional traffic is pretty awesome. Worst case scenario is that I’ll just keep buying more bandwidth. We’re doing okay with regards to disk space usage, but we go through bandwidth like a fat kid goes through cake! 

Now on to your regularly scheduled article!

Linux Boot:

There are any number of reasons why Linux will refuse to boot property. In most instances, you can easily fix your boot with ‘boot-repair‘. The boot-repair application is a handy, mostly automated, method to get your Linux boot-up process squared away.

It may be that you installed Linux improperly, or an update has somehow broken your boot. You could have a complicated boot process that has multiple operating systems configured and that has broken. There could be all sorts of reasons why your Linux system isn’t booting properly.

It’s for this reason that ‘boot-repair’ was created. Not only does it have an automated repair process, it has an advanced process that will let you create a diagnostics report to share with your favorite support forum, where you can get help with manually repairing your system.

Because of the many variations that are involved in the manual repair process, this article is only going to cover the automated boot-repair process. There are simply too many variables and brevity is important.

With that in mind, please continue reading…

Getting ‘boot-repair’:

The first thing you’re going to need is a Linux USB or DVD. There are a couple of ways to do this, but you probably still have the media from which you installed Linux in the first place. If you do still have that, you can just boot to the live instance.

As boot-repair isn’t necessarily installed by default, you’ll need to install it. That’s going to vary and depend on your distro, but it’s easy if you have Ubuntu or an Ubuntu derivative. Just use your keyboard to open a terminal by pressing CTRL + ALT + T.

Once you’ve done that, you’ll need to add the ‘yannubuntu/boot-repair’ repository, like so:

If you’re using a modern version of Ubuntu, it will add the repository and then automatically update the database of available software. If you’re not, or if you want to be extra careful, you can simply update it yourself with:

Next, you’ll install ‘boot-repair’. Seeing as you’re already there in the terminal, let’s go ahead and do it there:

Now that you have it installed, you can go ahead and open it from the menu.

Or Use the ‘Boot-Repair-Disk’:

If you don’t have any live Linux media kicking around, you can actually download a special distro that will get you sorted out. There’s a basic ‘boot-repair’ image that you can download from Sourceforge and you can use that instead.

If you’d like to download the ‘boot-repair-disk’, you can do so at this link. It’s a small distro that’s based on Lubuntu and has the tool you need for this. It also contains ‘OS-uninstaller‘ which, while interesting and handy, is beyond the scope of this article.

Once you’ve downloaded it and written it to USB or DVD (it’s just a whisker too large to fit on a CD as of the time of this writing), you can just boot to it and proceed from there. If you’re curious, it will look a little like this once you’ve booted and opened the ‘boot-repair’ application:

boot-repair-disk
That’s boot-repair-disk in action. You can use this instead of your regular distro.

Repairing Your Boot:

At this point, you have booted into a live instance of Linux and you’re ready to repair your broken boot. You can just open ‘Boot Repair’ from the application menu.

Once you do that, it will take a moment to collect information about your system. This is important, as it will use that information to repair your boot. As I mentioned up above, there’s too many variables to cover with the advanced options and there’s already a solution in place for that.

So, the simple thing you now do is use the automatic boot-repair and hope that it works. It usually does the trick and it’s pretty obvious how you do it. Still, have an image, just in case.

boot-repair in action
Just click the button! It should do the trick – most of the time.

All you need to do is push the button. Once you’ve done that, just go ahead and reboot. When you’re prompted, remove the installation media and let the reboot finish. The very next boot should be fine, as boot-repair will have done its job.

If it is not fixed, then you have a bigger problem than can be resolved automatically. In that case, click the bottom-most button and share the resulting report with your favorite support forum. Many Linux support forums have people who are used to seeing the output of boot-repair and they’ll get you sorted. If not, anyone at your favorite forum may still be able to read the information and help you get your Linux boot repaired properly.

Closure:

That’s it, really. This article only covers the automated repair. If it’s more complicated than that, it’s more complicated than a blog post and you’ll need assistance from someone who is familiar with how Linux boots.

As always, thanks for reading. Your readership and feedback make this task all the more enjoyable. If you feel like you can help, or that you want to help, just let me know and I’ll be able to find something for you to do.

Like normal, you can donate, sign up for the newsletter below, share the article on social media, leave a comment, register to help, or even write your own article. It’d also be pretty great if you unblocked the ads so that the site has a chance of making some revenue! If you have any questions, just contact me.

How To: (More or Less) Learn if Your Hardware Will Work With Linux

One of the most frequently asked questions from new people is them wondering if their hardware will work with Linux. This article will help you find out if your hardware will work with Linux.

That’s right, this article aims to tackle a frequently asked question – but there’s some limitations and wiggle-room. That’s why the title of the article contains (More or Less). It’s not 100% accurate.

The usual, and most basic way to find out if your hardware will work with Linux is to simply download the .iso you intend to use, boot to it, and test it. If it works in a live environment, it probably will work when you install it. If you needed to add additional boot parameters (like nomodeset) to run the live instance, you’re probably going to need to do the same thing when you install Linux.

That works well enough, but it doesn’t tell you anything about long-term problems. It doesn’t tell you if there’s going to be an IRQ issue many hours after booting, it doesn’t tell you if there will be some obscure ACPI errors, and it doesn’t tell you exactly how well your hardware will work with Linux.

You can do better than that. With a little effort, you can learn all about your hardware and how well your hardware will work with Linux. It’s pretty painless and easy.

Learn If Your Hardware Work With Linux:

So, the first thing you need to do is download the .iso and write it to USB or to DVD. You can also do this after the fact, with an already-installed Linux. This article assumes you’ve got a running Linux and you’re connected to the Internet. 

It also assumes that you have a terminal window open. If you don’t have one open, you can probably open one by using your keyboard. Just press CTRL + ALT + T and up should open your default terminal emulator. Yes, this should work just fine even in a live environment.

The tool we want for this is ‘hw-probe’, put out by the good people behind linux-hardware.org. It is almost certainly in your default repositories and can be installed in the usual manner. For example, if you’re using a distro with apt, then it’d be installed with:

You’ll have to adjust the installation command for the distro you’re using. You may also need to use a root password, which will vary based on the distro.

You can also find it in Snap, AppImage, and Flatpak versions here.

Once you have it installed, you will want to run the following command (and know that you will be sharing this data with the linux-hardware.org project):

That will take a little while to run, but not terribly long. It will output some text similar to this:

The important bit is the “Probe URL”. For this particular run, you’ll see the URL is: https://linux-hardware.org/?probe=23182c745b

If you follow my example URL, you’ll see that everything more or less works – but that some of the hardware has some known problems. You can click through those to learn about what sort of problems you’ll have getting your hardware to work with Linux.

NOTE: Just because there are known problems doesn’t mean that the hardware doesn’t work. You need to click through and read the results to learn what sort of problems you’re potentially going to face. In some cases, the problems only exist with certain kernels (for example) and are resolved with newer kernels. Again, you’ll need to read through and verify the data. The data is pretty accurate, but the human element means it is not infallible. 

As you can now surmise, this isn’t 100% accurate. Quite often, there will be known problems but your hardware will work with Linux just fine – but maybe not at peak functionality due to an inferior driver. Be on the lookout for things like that.

What it does do is it gives you some more fine-grained information so that you can make a more informed decisions. It’s a guide, not a rule-book. At the end of the day, if Linux is up and working on your live instance, it’s probably going to work just fine when it has been installed.

Closure:

And there you have it. Another article in the books. This one helps you find out if your hardware works with Linux. If you have any ideas for articles, be sure to let me know. Don’t forget to share this article with your friends!

If you want, you can unblock ads, donate, sign up to contribute, write an article, or sign up for the newsletter below. (I should move that to the top. I’ll do that when I’ve given it enough time to see if folks respond.) Thanks for reading and there will be another article in a couple of days!

How To: Generate a List of Installed Applications in Linux

Before making this site, I had a similar article that explained how to list installed applications in Linux, but it was only relevant to those that used distros with ‘dpkg’. This expanded article will explain how to generate a list of installed applications for multiple distros, in order to be more complete.

There are any number of reasons why you might want a list like this. Maybe it’s for compliance reasons, needing to know everything installed on the machine. Maybe it’s for making a manifest to establish a baseline for future installs. You could also just be curious, need a list for support questions, or want a list for backup purposes.

Whatever your reason, you can generate a list of installed applications fairly easily. You can also do a couple of other neat things that I’ll explain below.

Generate a List of Installed Applications:

For all of these commands, you’ll want a terminal. You can probably open your default terminal by using your keyboard to press CTRL + ALT + T. If that doesn’t work, you can just open it from a menu or whatever shortcut you’ve set up for yourself. (I’m looking at you, you people with strange window managers!)

The command you’ll use will vary depending on your distro. I’ve got a few of them covered below. In some cases, you may need elevated permissions, so a ‘sudo’ in the front of the commands should do the trick for you.

Debian (& dpkg using distros):

If you’re using Ubuntu, or a distro with snaps, you can list those with:

If you’re using flatpak applications with any distro:

Arch (& Mandriva, etc.):

RHEL (& Fedora, etc.):

OpenSUSE (& derivatives):

Those are the major distros. There are smaller distros, independent distros, and they’ll have their own package management systems and ways to make a list of installed applications.

Bonus:

You can actually do a few things with this listing. Two immediately come to mind and I’ll share them.

First, you can count them. At the end of each of these commands, you can pipe it and count the lines. It may not be a 100% accurate number, but it will be pretty close. (Some of the commands output more than just a list of installed applications.)

That’ll give you an output similar to:

You can also write the list of installed applications to a text file, to save for archiving or whatever. I like to make a list now and then and check against it when I do a new installation. Your reasons are your own, but here’s how:

The .txt isn’t mandatory and you can write the file to anywhere you want, assuming you have the correct permissions. It’s your list, you can do anything you want with it!

Closure:

And, there you have it. You can now make a list of all applications that you’ve installed. You can even count the list, and you can write the list to a file for storage. If you want, you can generate a list of installed applications on one computer, generate a list of all applications on a second computer, and then use ‘diff’ to see what the differences between them are. There’s all sorts of things you can do with this list.

As always, thanks for reading. Your reading and feedback help me stay motivated. My goal is to keep up this publication rate for a year, though we’ll see where we are when that year ends. I have enough notes for that, and more. 

If you’d like to contribute, you can unblock ads, you can sign up for the newsletter, you can write an article, you can donate, and you can register for the site to regularly contribute. You can also comment, vote for articles you do like, and share this site/page with others via social media! You can even buy inexpensive Linux hosting! Alternatively, you can even just enjoy the articles. It’s all good!

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.