Amahi DNS not working

Amahi has proven itself to me as a solid and reliable home server solution. However, occasionally, I’ve had a problem where DNS stops working, sometimes after OS updates have been installed and the server restarted. It’s only happened 2 times over the last year or two, and the helpful Amahi folks on the IRC channel came to the rescue both times, but I’d thought I’d document the solution here.

Sympton: You use the Amahi network troubleshooter, and find you can’t ping hda from your hda box, i.e. name resolution is not working.

Solution 1: If you are running a desktop version of linux, or have installed some specific packages, like Jenkins, that install libvirtd service, then you need to disable that service. Unfortunately libvirtd takes the default DNS port and therefore Amahi, which uses dnsmasq, can’t work. This is documented here, and the solution is to use:

sudo systemctl disable libvirtd
sudo reboot

Solution 2: If you can now ping hda, but still can’t ping www.google.com, it means the DNS provider that amahi uses for the web is not reachable. Amahi support multiple DNS providers: OpenDNS, OpenNIC and Google Public DNS. Mine was set to OpenDNS, which I think is the default, the solution was to change it to Google DNS.

If you haven’t tried Amahi, and you have a home network with a bunch of computers, I highly recommend checking it out!

Flushing Amahi (dnsmasq) dns cache

The latest version of Amahi uses dnsmasq for network management including dns caching, which works really well. However somehow my Windows 8 laptop’s wifi was enabled at the same time as it’s ethernet LAN connect, and so the laptop ended up with two IP addresses. This is probably due to some bug in Windows 8, but even after I disabled the wifi adaptor, rebooted both my Amahi server and the laptop, the dns cache still retained the now unused IP address for the disabled wifi adapter. In the end I had to manually edit the dnsmasq.leases file in order to fix this – here’s how (as root on on Fedora 21):

1. View your dnsmasq leases to confirm there’s a bogus address you want to remove:

[root@hda-com]# cat /var/lib/dnsmasq/dnsmasq.leases

2. Stop the dnsmasq service

[root@hda-com]# service dnsmasq stop

3. Edit the dnsmasq.leases file to remove the bogus address(s):

[root@hda-com]# nano -w /var/lib/dnsmasq/dnsmasq.leases

2. Start the dnsmasq service

[root@hda-com]# service dnsmasq start

Then renew your client’s IP adress (e.g. using ipconfig /renew on Windows) and you’re done.

VNC to Linux PITA

A stubborn or short-sighted developer, it seems, is the cause of many people’s grief and effort to get VNC working to a linux box from any of the standard VNC clients (tiger, realvnc etc.). As of Fedora 19+, the code has changed in vinoserver, the default linux VNC server, such that the encryption mechanism is incompatible with ALL standard VNC viewers. You’ll see something like ‘No matching security types’:

tiger

The only option for the average user is to disable encryption. Pretty stupid, but I’ve seen this before. A developer ‘David King’ says “My code is right, everyone else is wrong.” and marks a bug as ‘NOTABUG’. How sad. Anyway, until someone else can take a look at this from another perspective, make sure you only use VNC to linux on a secure LAN environment and then do this:

gsettings set org.gnome.Vino require-encryption false

Make sure you do it as standard (not sudo) user. Sucks to disable security – but if complexity is a barrier to entry, that is the result. 🙁

Netgear GS605 v2 is faulty!

I have two of these switches, and I just got stung by a nasty hardware fault that is present in version 2 of this device: when you have two of these devices connected to each other (or just on the same LAN), the throughput for all connections on one of them will drop to a few hundred Kb/s e.g. 400Kb/s! This effectively cripples the LAN which should normally have file transfer speeds of > 25Mb/s.

This has been reported on the Netgear forums here and Netgear have acknowledged the fault. Unfortunately there is no solution other than replace one of the devices with something else (apparently v3 of the GS605 works ok), but I learned a few tricks for how to diagnose network bandwidth issues in the process:

  • Use iperf.exe. This is the standard command line app for testing network bandwidth, and work on both linux and Windows. On linux just sudo apt-get install iperf, on Windows download from here.

    It’s easy to use: on one machine, start a server using:

    iperf -s

    On another start a client duplex test to the server using:

    iperf -c [server ip address] -d

    The results will be printed after a few seconds.

  • Use a good Cat5e or Cat6 ethernet cable. Cables can easily be faulty, check for green lights on your NIC & switch port to indicate 1000Mb/s (gigabit) connection speed.
  • Avoid PCI Gigabit cards (use onboard Gb NIC). PCI but is limited, especially if you have any other devices on the bus.
  • Use a decent file-copy utility. For example, SuperCopier, that instantly shows you your copy speed.

GVFS folder moved from ~/.gvfs

Network shares were previous mounted under a hidden folder in your home directory called gvfs. In recently distros of Ubuntu and those based on it, such as Mint, this directory has now moved to:

/run/user/[username]/gvfs/

and the name of the folder under there for each share is really complicated, like:

smb-share:domain=yourdomain.com,server=hostname,share=files,user=username

which is really not very nice. So you should make a symlink to it like this:

ln -s "/run/user/[username]/gfvs/smb-share:domain=yourdomain.com,server=hostname,share=files,user=username" ~/files_on_hostname

or something similar.

Missing cursor in SSVNC session on Linux

When I use SSVNC to open a session on a remote linux box, my mouse cursor often appears as a single pixel dot (no arrow) which is extremely difficult to see. I found that to solve it, the easiest thing to do is press F8 after your connection has started, then deselect ‘Cursor Shape’ from the SSVNC popup window that appears, then click the mouse once (within the client window) to get your cursor to switch to an arrow.

Wish I could make it do that by default…

VNC to Linux Mint Mate gives ‘Connection Refused’

After a fresh install of Linux Mint 15 with Mate, and enabling Desktop Sharing, I was getting ‘Connection Refused’ when trying to VNC from other machines. The same steps on Linux Mint 15 with Cinnamon on the same box showed VNC was working and hence the problem was caused by Mate. After some research it appears this is a known issue, but luckily there is an workaround until it is fixed properly – follow the steps here.

It seems like a lot of people are using an alternative VNC server like tightvnc which gives a different desktop to the console, but for some reason I just want to have one desktop, which is the console one, so if i’m working directly on the machine, I can walk away and work remotely picking up where I left off locally.

Mint continues to be my preferred distro, hopefully this issue is resolved in a future update.

No mobile data access on Android phones

I just got a bueat new phone, the HTC Desire X, but one day two I suddenly had no internet access when on a mobile network (wifi was fine). The ‘Mobile Network’ setting was switch ON and toggling this switch didn’t do anything. I learned you have to check your APN (Access Point Name) settings by going into the Mobile network settings, then ‘Access Point Names’ and I saw that there was nothing listed there! Hit ‘Menu’ key and there’s an option to ‘Reset to defaults’. After I did this, my network operator’s settings appeared (Virgin Mobile Australia) and all was well!

VMWare Networking Conflict

If you have both VMWare and VirtualBox installed, you may find that VMWare virtual machines can’t get an IP address. If you get a 169 address it means a DHCP server could not be found, which basically is game over for networking. Check the VM properties (after shutting down the VM), go to the networking option and choose “Configure Adapters”. By default all adapters are selected, but you should disabled all except your real adapter (in my case, RealTek).

vm-networking-issue

Mouse cursor missing using linux VNC viewer

Seems like the best vnc viewer on linux is ssvnc, much better than the basic tightvnc viewer, however both programs can have an issue where your remote mouse cursor is dipayed as a single pixel (dot) instead of an arrow making it extremely difficult to track. In my case I was VNC-ing from a Linux Mint 13 box to a Fedora 14 box. The solution using ssnvc was to press F8 after connecting, and unselect ‘Cursor Shape’ from the popup menu. However changing this option via the F8 menu does means you will have to do this each time you connect. If you have saved a connection profile, from the connection dialog you can click ‘Options…’, then ‘Advanced…’ then ‘Unix ssnvcviewer…’ and tick ‘Use X11 Cursor’. This solved the problem for me for future connection using that profile. You’ll have to do this for each connection profile unfortunately.

If you know of a better vnc viewer for linux that doesn’t have this issue, post a comment!