Category: Computers

Windows RDP and Remmina: “Unable to connect to RDP server”

If you’ve been using Remmina to RDP to a Windows machine for some time and then all of suddenly find yourself running into the error Unable to connect to RDP server <address>, take a minute to read my experience before you go through some possibly-unnecessary steps.

I occasionally reboot my modem and router, and after doing so tonight, I found I was unable to RDP into a machine running Windows 7 Ultimate on my LAN from Remmina. I immediately checked to see if I could RDP to a Windows Server machine on the same LAN from the same Remmina client and could. So, I ruled out Remmina being the problem – or so I thought.

My next check was at the network. I figured that maybe the machine was either not connected to the network or had been assigned a different IP. So I then connected a monitor the machine and checked via ipconfig to verify that the IP address was the same. I still decided to reboot my router again.

Next, I checked and rechecked the RDP settings on the Windows machine to ensure that RDP was enabled. Everything looked fine on that end, so I moved to the firewall settings. The firewall was set to allow access to RDP on the machine.

Next, I went to the net for support. I searched “unable to RDP into Windows” and naturally found lots of various explanations and solutions. Knowing that I have VirtualBox setup on the computer with network drivers installed, I decided to narrow my search to include that. That’s when I found explanations regarding issues caused by the Host-Only virtual network connection that Windows sees as an “unidentifiable” network connection type. Having had issues with this limiting my network access on a computer in the past due to Windows taking precautions in thinking it is connected to an insecure network, I jumped at several solutions that involved registry edits to tell Windows that the network connection was virtual and host-only – and that it terminated at the machine itself. Re-enabled the driver and found problem was not resolved.

I then decided to boot into Windows on my laptop and see if Windows’ own RDP client could connect to the machine. It did, but the connection seemed sluggish. I then became suspicious that either the network or the machine’s NIC were somehow at fault – which didn’t rule out in my mind that the connection on the machine created by VirtualBox could be to blame as well. I then went into the Network and Sharing settings on the machine and disabled the connection. Rebooted the machine and found myself facing the same problem.

Finally, I wisened up and searched for help: “unable to connecto to Windows RDP using Remmina” and found the solution to my problem. Again, there were several suggested solutions, but I did find the one that worked for me. One solution suggested changing the Advanced > Security value in the connection’s profile in Remmina to RDP. This not only didn’t fix my problem, but caused additional problems with connecting to the machine.

The solution, surprising enough, was as simple as removing an entry in a file. I simply opened .~./freerdp/known_hosts and removed the line that corresponded to the host. I restarted Remmina and tried to connect, getting prompted to accept the host’s key, and was happily connected. Was a little agitated that I spent so much time and work trying to resolve a problem that was so easily fixed, but happy to again have the ability to RDP into my machine.

Ubuntu Unity Dash: Removing Links

There are occasions when applications that have been removed have stale links left behind in the Unity Dash. Though it is harmless, it is annoying to see them popup as results to searches in the dash when they are useless – creating a problem by taking up search results that could lead to what you’re searching for more quickly.

Removing them is fairly simple, but it can be easy to forget if you haven’t done it before – or at least not for a while.

Most of the links in the Unity Dash are stored in the /share/applications folder. However, depending on if the application was installed for just one user or for all users determines which folder the links are stored at. If the application was installed on the system for all users, you will have to use root access to remove them from the /usr/share/applications directory. If they were installed by a user strictly for that user, they will be in the .local/share/applications directory within that user’s home.

Make sure you empty your Trash after you delete the links. They will not be removed from the Dash until you do.

Ubuntu: Creating non-buntu Startup Disks

I ran into this problem while trying to create a startup disk for OpenSUSE in Ubuntu using the included Startup Disk Creator. I noticed that only Ubuntu and Ubuntu-based isos were being listed in the program, and even when browsing to the other isos, I found that clicking to open them in the program did nothing.

After some brief searching, I came across the following thread in Ubuntu Forums. The second post within the thread was extremely helpful to me, and following its instructions led to a successful bootable USB drive with which I was able to test OpenSUSE. On top of that, I learned from the post that the Startup Disk Creator software included in Ubuntu is actually limited to only Ubuntu-based isos.

So, I thought it would be worthwhile to repost the command here on my blog for both my own records and for anyone else who might not have managed to come across the use of dd to create bootable disks in Ubuntu. From what I understand, it should work for just about any type of bootable disk. However, I can only testify that it worked for the OpenSUSE disk from my own experience so far. As always, make sure you are certain of what you’re inputting when working with CLI, and this command could cause some serious pain in terms of data loss if you accidentally designated the wrong location.

sudo dd if=/path-to-iso of=/dev/sdX bs=4096

The command should be fairly straight-forward. The if argument should be the full path that points to the location of the iso. The of argument should be the device that is being written to as the startup disk. That’s probably obvious, but I felt it was necessary to clarify just in case. I’m assuming that bs is referring to the boot sector location of the device being written to, but that is purely speculation on my part and the value was simply left as-is when I used this method of creating the boot disk.

You can also use the mount  command to list all mounted devices currently connected to your computer. If you know the name of the device (which you can see by hovering over the USB drive’s icon on the Unity launcher) you can then look through the list of devices displayed from mount  and find what device it is so that you supply the right value for the of argument when using dd. A more graphical method would be to open the Disk Utility and find the USB drive listed in the left pane. Clicking on it will then display the device information in the right pane, including where the device is mounted.

I’ve been meaning to create a Windows boot disk using this, to at least see if it would work. I need to re-install Windows on a laptop that doesn’t have a disc drive built into it, and the USB method seems my best option. I’ll add a comment or update the post with the results once I run it.

Before Installing Windows…

For anyone who is considering an upgrade for Windows, heed this warning before you choose to do so via a fresh install: get your drivers ready.

Many people take for granted that Windows works right out of the box. I think it is especially the case considering that Windows actually doesn’t work right out of the box. In most cases, Windows can’t even successfully find software drivers online when trying to install a simple peripheral device, so it surely does a poor job of working with the essential hardware of your PC as-is.

If you don’t know what I mean, then it means you’ve never taken a standard Windows installation and used it to install Windows onto a PC before. It’s safe to say that everyone is familiar with purchasing a computer with Windows pre-installed. In some cases, you may even be familiar with the luxury of having a Factory System Restore CD/DVD, though it’s not common with new PCs today. Either way, the biggest difference between having a Factory System Restore option (either on as physical medium or as an image on the hard-drive) and a standard installation method (Windows, of some version and edition, that you buy separately to use on any PC) is that the Factory System Restore method will include the drivers for your PC’s hardware already included. When you use the Factory System Restore image, your PC will boot up with the resolution looking nice and all network peripherals working as they should. Yet, if you install Windows from something other than a Factory System Restore image that is made specifically for your PC, you’ll find the resolution to be poor (and unchangeable) and no ability to access the internet even through your wired ethernet port.

In one of few ways, this is how Linux distributions really have a one-up on Windows. Because most essential hardware will work before you install the additional drivers, especially the ethernet port (which allows an easier path to obtaining essential drivers). When I installed Windows, I had to find a copy of my PC’s mobo, video and ethernet drivers, place them on a USB drive and then put them onto the PC I had installed Windows on.

In all truthfulness, Windows worked great after installing the drivers, but the real point is that you need to know to do this. I’ve heard of some people installing a Windows upgrade and then reverting back to their previous Windows version because they thought there was an issue with their PC being able to run Windows when they were presented with the lower resolution and unusable ethernet.

So, be prepared. Because if the PC you’re upgrading is the only one you have access too, and you don’t prepare a way to install the drivers onto the PC without internet-access beforehand, you might find yourself in a tough situation – such as with a temporarily useless PC.

PC Hardware Failure

Coincidental circumstances that happened to fall into line over the past couple of weeks led me to believe that issues with Ubuntu’s latest download update for 12.04, 12.04.3, were causing problems with my system. Of course, if you installed 12.04 from the moment it was first released and have updated each time kernel updates and other core package updates were posted, then you are basically running the same thing as 12.04.3 anyway – it just includes more recent updates in the download to help keep from having to get any more updates than is absolutely necessary if you’re grabbing the OS over a year later.

But anyway. After running into some issues with Unity after installing Cinnamon on my system to check out how it ran under Ubuntu, I could not figure out how to recover Unity’s lock screen and screensaver functions. Cinnamon overwrote them and they remained gone after removing Cinnamon from my machine. So I decided to simply re-install Ubuntu – figuring that a clean install would be nice anyway. Since I was doing a fresh install, I decided to go with 13.04 and see how well I liked using it on a daily basis.

After about a week or so, I decided I’d rather go back to 12.04. However, I knew that the ISO for 12.04 was getting updated to 12.04.3 only a few days from that moment, so I chose to stick with 13.04 until then. After getting 12.04.3 and installing it, I found that the Ubuntu splash screen was never displayed during boots and shutdowns (with the exception of running it from LiveUSB before installing), and also that the graphics lagged at times – especially when viewing videos or minimizing and revealing windows. I hadn’t seen any issues in 12.04 prior to installing 13.04, or any issues in 13.04 after that, so I figured that it must have been something within the 12.04.3 update that was causing the problem. Still, I gave a re-install of 12.04.3 a chance to see if maybe there had been something else done along the way that I’d overlooked. However, the issues remained. So I decided to grab Linux Mint 13 and see if it would give me any problems. It had the same issues with the splash screen, but there didn’t seem to be any latency issues in the graphics, so I was satisfied.

I was using Linux Mint for maybe a week before my screen suddenly locked up, leaving me unable to do anything, and then the computer simply hard crashed a few seconds later – powering off immediately. I pressed my Power button and nothing happened. I waited a few seconds and pressed it again. Still, nothing happened. I then held it down for about 15 seconds, getting no response. Finally, I decided to go down to the PC and look at it. After touching the top of the PC, I realized it was extremely hot. So hot, in fact, that I could not keep my hand on it for more than about five to ten seconds. Naturally, I began to worry that I was looking at some serious hardware damage.

My initial thought, since the PC would not power-on or even show a light on the ethernet interface, was that the motherboard was fried. However, I pulled the cover off of the PC and looked around for any signs of burn damage or ruptured capacitors and found nothing. Still, when plugging in the power cord, I could not get any kind of reaction that indicated the system wanted to power-on. I did, however, notice that the main fan on the motherboard would twitch the moment I first plugged in the power cord. It was late, so I decided to call it a night.

The remaining few days had me looking around for a cheap PC replacement, because I needed to have something to do my school work on, and I didn’t feel like I could manage with just the laptop. I’m someone who prefers to use a desktop PC. However, I realized about the second day out that the video card had been located on the mobo right where the case felt so hot. So, I decided to open the case and pull out the video card, then plug in the PC and hit the power button. Sure enough, the fans kicked on and the PC started booting up (or at least as far as I could see at that moment). Attaching the monitor via the onboard VGA port proved that the video card was indeed the sole culprit. A video card replacement had me back up and running.

I guess the reason I decided to type out this whole post and explain my situation is that I’m not really the most savvy PC troubleshooter, and that sticking to my original assumption of the mobo being lost would have had me spending lots more time and money getting back to a desktop PC. I just hope that other people out there who run into similar issues, even if it is with other hardware, will consider my experience and keep an open mind to all the possible causes of their PC’s issue before taking extreme measures – just in case it may also wind up being a quicker and easier (not to mention cheaper) fix as well.

Ubuntu / Linux Mint: Adding the LibreOffice PPA

If you’re using a previous version of Ubuntu or Linux Mint, such as 12.04 or 13 (the last LTS releases), then you’re probably using an old LibreOffice suite – at least if you choose to use LibreOffice. I believe version 3.6 is in the 12.04 repositories – which I also believe is what is used by Linux Mint 13. There’s nothing wrong with LibreOffice 3.6, but there’s also nothing wrong with wanting the latest and greatest, and 3.6 is quite a few releases behind the current LibreOffice update.

Luckily, whether you wish to re-install LibreOffice or simply update the installation that comes pre-packaged with Ubuntu / Linux Mint, getting the latest version is easy as one command line in terminal.

Simply add the LibreOffice PPA:

sudo add-apt-repository ppa:libreoffice/ppa

You will also want to update the package index:

sudo apt-get update

After this is done, simply load up the Update Manager for whichever OS you’re running, click Check and you’ll find updates listed for LibreOffice. Ubuntu typically prompts to run a partial upgrade, which is fine. I didn’t see this in Linux Mint.

If you’ve removed LibreOffice and need to install from the PPA after you’ve added it, simply submit the following command:

sudo apt-get install libreoffice

That’s it. Whether you upgrading or doing a fresh install, you’ll have the latest release of LibreOffice, along with continuous updates to the application through your Update Manager.

Linux Mint MATE: Default Num Lock, Keyboard Shortcuts and System Monitor

This post is in reference to an earlier one, which can be found here.

The difference is that this example refers to Linux Mint using the MATE desktop environment. The reason I’m posting this is because I’ve recently installed Linux Mint with MATE, and was shocked to not only find no keyboard shortcut for System Monitor (which is missing by default in Ubuntu as well) but also no shortcut to terminal. So, I will explain how to add these. The steps are actually just as simple as the ones used for adding shortcuts to Ubuntu.

Personally, I find the layout of the configuration GUI for keyboard settings a little less convenient in Linux Mint from Ubuntu’s Unity, but it’s still usable and I was able to get the job done just fine without referring to any help online. The place where I found myself stuck for a second was the command used for launching these applications. In Ubuntu, System Monitor is accessed by the command gnome-system-monitor. However, in Linux Mint with MATE, it is mate-system-monitor. Not really all that shocking once you realize it, but it took me a minute to realize that I wasn’t using Gnome or a relative desktop.

But anyway. To configure keyboard shortcuts in Linux Mint with MATE, simply go to the Menu on the taskbar and click Control Center, which is about five options up from the bottom. Under the Personal category, which is at the top of the window, you’ll see Keyboard Shortcuts, which is likely the second option down from the top at the far right. One this window is opened, you can just stop. Don’t bother looking for a shortcut for either Terminal or System Monitor – just in case you’re thinking one may exist. It doesn’t, at least not if you’re using Maya. When you’re ready to create a shortcut, just click the + Add button at the bottom. The new window that pops up is exactly like what is seen in Ubuntu. Two lines: one for the title and one for the command that is called. If you wish to create a shortcut for Terminal, the command should be mate-terminal . If you wish to create one for System Monitor, the command should be mate-system-monitor , as mentioned earlier in the post. Then assigning the key combination for the shortcuts is also exactly as in Ubuntu: you simply click the shortcut you created in the list and then when it says New shortcut to the right, you hit the key combination you wish to use on your keyboard. Done.

Lastly, if you wish to have Num Lock turned on by default when you log into Linux Mint, simply open up Control Center from the Menu (as explained above), click Keyboard under the Hardware category, click the Layouts tab at the top, click the Options… button near the bottom, expand the Miscellaneous compatibility options branch and check the box next to Default numeric keypad keys. If you’ve done this in Ubuntu, you’ll also see that this is very similar.

Ubuntu Server 12.04 – Changing Network Interface from DHCP to Static

I suppose this can be followed to set a static IP on your local network in Ubuntu Desktop as well, but this is explained with the expectation that you’re using terminal on an Ubuntu Server setup.

There are plenty of explanations of how to configure the server to use a set static IP instead of getting assigned one automatically by a DHCP server, but it seems that most tend to be incomplete. For example, it’s easy to find an explanation of editing the /etc/network/interfaces configuration to change a particular interface from using DHCP to a static address, but that seems to be where most end – which many will find leaves them unable to resolve any addresses outside the LAN after a system reboot. So I’m going to explain what I do that gets around this problem.

For every command you see here, I am executing them as root – which in some cases may require you to have sudo preceding it if you’re not. You can use the following command to login as root.

sudo su

First off, you need to open /etc/resolv.conf and note the listed IP addresses for the nameservers your server is automatically using with the DHCP settings. The reason you need to record these values is because when the machine is rebooted, the /etc/resolv.conf configuration gets overwritten – and the overwritten values will be empty since there is going to be no DHCP server providing them anymore. This is done by the DHCP client that is running on the server. Another workaround is to disable or remove the DHCP client, which will then stop the configuration from being overwritten – allowing the sustained values in /etc/resolv.conf to do the job. But I didn’t want to do that just in case I ever want to resume using the DHCP client later on, or in case I wanted to still use it for a different interface. I used nano to open the configuration.

nano /etc/resovl.conf

I simply copied the values for each nameserver in an open text editor, but you could write them down by hand on a notepad if that’s what you prefer.

The next step is the same as most other explanations: opening the network configuration and setting the static IP address.

nano /etc/network/interfaces

You’ll typically see configurations for just two interfaces here: the lo (or loopback interface) and eth0 (or the primary network interface). The settings for the primary network interface are the ones we want to edit. If your machine has multiple ethernet ports, you may see more than one, but in most cases you will just see the one. By default, it should look something like this.

# The primary network interface
auto eth0
iface eth0 inet dhcp

Instead of deleting the settings, I prefer to simply comment them out by placing a hash in front of them.

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

The only reason I do this is so that if I decide to revert back to using DHCP for that interface, I only have to uncomment the lines and either remove or comment out the lines that I added to configure it for a static address.

The next step varies depending on the network. If you’re doing this for a home network running on a common residential router, it’s likely that the values for netmask should be the same (255.255.255.0). However, the other values could be slightly different, but hopefully you are aware of what they are if you are configuring any network settings in your home. For me, the network used the address range of 192.168.0.0 to 192.168.0.255 (including the network and broadcast addresses). The gateway address is almost always the first address in the network and assigned to the router itself, which for me is 192.168.0.1. I chose to assign the address of 192.168.0.100 to the Ubuntu server (similar to most other examples). Lastly, I included the values for the dns-nameservers since we will not be able to get them from the /etc/resolv.conf location after the network service has been restarted with our changes.

# The primary network interface
auto eth0
iface eth0 inet static
	address 192.168.0.100
	netmask 255.255.255.0
	gateway 192.168.0.1
	network 192.168.0.0
	broadcast 192.168.0.255
	dns-nameservers 0.0.0.0 1.1.1.1 2.2.2.2

You should replace with the values you see in my example on the line for dns-nameservers with those you recorded from your /etc/resolv.conf configuration. Each entry for the dns-nameservers should be separated by a space as shown. Do not create a new line with dns-nameservers <address> for each entry or else the network service will not accept it.

After doing this, you can simply restart the network service to apply the new settings, which apparently must be done as root – gives permission errors for me when trying to do it using sudo.

/etc/init.d/networking restart

Once this is done, you can check the active network settings to make sure the server is using the new address for the interface.

ifconfig

If everything looks good now, you should restart the server – place sudo in front of the command if not executing as root.

reboot

After the server has rebooted, test that the nameserver configuration did work and you can resolve outside addresses by pinging an address such as Google.

ping www.google.com

If you do not get an error, everything should be good to go. 🙂

Ubuntu Unity: Keyboard Shortcuts and System Monitor

The Unity launcher is nice, and, like with Windows since version 7, you can pin – or “lock” – items to the launcher by right-clicking them when they’re running. For me, locking the System Monitor to the launcher was always one of the first things I had to do after setting up a new install of Ubuntu – though it could also be accessed by simply searching “system monitor” in the Unity dash. However, since upgrading to 13.04, I decided to try keeping a cleaner system, and that also meant not having a cluttered Unity launcher.

For me, some things are necessary to have on the launcher, such as my browser of choice, a link to LibreOffice and the files link to my Home directory. However, keeping things like Terminal and System Monitor seemed unnecessary, especially since there is already a shortcut to Terminal by default (CTRL+ALT+T). Being someone who was primarily a Windows user up until a little over a year ago, having a shortcut to an application that managed and monitored running processes was something I was used to and therefore depended on, and CTRL+ALT+Delete has always been the sacred keyboard combination for it. Luckily, setting up a keyboard shortcut in Unity to run its System Monitor isn’t difficult and only takes a minute to do, so long as you know the command for the shorcut.

  1. Go to System Settings > Keyboard and click on the Shortcuts tab.
  2. (Optional) If you’re assigning CTRL+ALT+Delete to open System Monitor, click on the System option under the category panel, click on Ctrl+Alt+Delete beside “Log out” and, when it says “New accelerator…” hit your backspace key to disable the shortcut.
  3. Click on Custom Shortcuts under the category panel.
  4. Click on the “+” icon below the shortcut list pane.
  5. In the field titled “Name:” type in the name of your shortcut (can be anything that tells you what it does).
  6. In the field titled “Command:”, type out the command you want the shortcut to process. In the case of running System Monitor, the command is gnome-system-monitor.
  7. Click on “Disabled” beside the name of your shortcut and when it says “New accelerator…” hit the key combination you wish to use for the shorcut on your keyboard, which you should then see listed in place of “Disabled” after you’re done.

Ubuntu Server: Adding Users to the Sudoers List

If you have ever ran an Ubuntu Server installation, you may be familiar with the /usr/sbin/visudo file, which lists everyone with super-user permissions on the system. The only user that is in the file with ALL permissions by default is root, which, by default, isn’t even accessible directly in current Ubuntu versions. Though the root user can be assigned a password so that logging in as root is possible, no one would recommend it – or at least no one that I have seen.

When you install Ubuntu Server, you create an initial user. This user is automatically placed in the sudoers group, which means this user can perform actions as the root user by using the command sudo su  and providing their password. Perhaps you’ve wanted to create an additional user and add them to the list of sudoers so that, like your initial user, they can use the sudo  command. Well, it only takes two commands to do this.

First, you create the user using the adduser command:

sudo adduser <username>

At this point, some tutorials online explain how to add this user to the /usr/sbin/visudo file with the same permissions as the root user. If you do this, you will practically be creating a duplicate root user who can do anything on the system. Instead, it’s best to simply add this user to the sudo group:

sudo adduser <username> sudo

If you exit your current terminal session, reopen the terminal and log in as the user you just created, you’ll notice that this user can also perform actions using the sudo  command.

You can also check to see that the user is in the sudo group by viewing the groups users:

grep sudo /etc/group

Make sure the user is listed after your initial user and any other users you may have already added.

Similarly, you can remove a user from the group using the deluser  command:

sudo deluser <username> sudo

I recommend issuing the grep sudo /etc/group  command to ensure the user was removed as well.

Also, take note that the initial user created when installing Ubuntu 12.04 is added to the following groups as well, so if you’re intention is to create a user who is an ‘administrator’ on the machine, it may be wise to add them to all of the following groups.

adm
cdrom
sudo
dip
plugdev
lpadmin
sambashare

To see the list of groups on your server, simply issue the command grep <username> /etc/group , where <username> is the user you initially created during system install. Of course, you can ignore the group with the same name as the user.