Robert Basic's blog

Posts tagged 'fedora'

Enable UDP for NFS on Fedora

by Robert Basic on July 03, 2017.

Recently bringing up Vagrant boxes started acting up when mounting the NFS shared folders. This is the error message I get:

==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.33.1:/home/robert/projects/project/application /var/www

Stdout from the command:



Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

For some reason NFS doesn’t like UDP on my machine, but as far as I know, UDP is the default in Vagrant.

This can be changed by telling Vagrant to not use UDP for synced folders, by adding nfs_udp: false:

  config.vm.synced_folder "./application", "/var/www", type: "nfs", nfs_udp: false

But as this is something only I have experienced in my team so far, “fixing” it on a project level seems like a bad choice. And when the next project comes, I’ll probably have the same problem all over again.

Digging a bit deeper, I’ve came across this ServerFault answer, which says that since nfs-utils version 2.1.1 UDP support for NFS is disabled by default.

The solution is to edit /etc/sysconfig/nfs and add --udp to RPCNFSDARGS:

RPCNFSDARGS="--udp"

Restarting the NFS server and Vagrant mounts the shared folders without problems again!

Happy hackin’!

Tags: fedora, nfs, udp.
Categories: Development, Software.

Issues with Vagrant after upgrading to Fedora 25

by Robert Basic on December 24, 2016.

Fedora 25 was released over a month ago, so I decided it was time to upgrade from 24.

Using the dnf plugin system-upgrade the entire process went smooth. The Fedora Magazine, as always, has a nice post on how to upgrade.

So far I ran into only a couple of minor issues with Vagrant.

The first one, which isn’t really a problem, is that Vagrant got downgroaded to version 1.8.x from 1.9.1 which I had installed in Fedora 24. The fix for that is easy, just install the new version again:

robert@odin ~$ sudo dnf install ~/Downloads/vagrant_1.9.1_x86_64.rpm

The second issue was that, well, vagrant didn’t really want to work. When trying to run vagrant up it would spit out the usual kernel module is not loaded error.

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

Running VBoxManage --version provided a helpful message, for once:

robert@odin ~$ VBoxManage --version
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.8.15-300.fc25.x86_64) or it failed to
         load. Please try load the kernel module by executing as root

           dnf install akmod-VirtualBox kernel-devel-4.8.15-300.fc25.x86_64
           akmods --kernels 4.8.15-300.fc25.x86_64 && systemctl restart systemd-modules-load.service

         You will not be able to start VMs until this problem is fixed.
5.1.10r112026

Looking at the list of installed packages with dnf list installed I saw that both the akmod-VirtualBox and the kernel-devel packages are installed.

Running the next command fixed the issue:

robert@odin ~$ akmods --kernels 4.8.15-300.fc25.x86_64 && systemctl restart systemd-modules-load.service
Checking kmods exist for 4.8.15-300.fc25.x86_64            [  OK  ]

VBoxManage shows no warnings any more:

robert@odin ~$ VBoxManage --version
5.1.10r112026

and Vagrant works just fine again.

Happy hackin’!

Tags: akmod, fedora, vagrant, vboxmanage, virtualbox.
Categories: Development, Software.

Configure Fedora's firewall for Vagrant

by Robert Basic on December 09, 2016.

This one’s been in my drafts for a long time, might as well publish it.

FirewallD, Fedora’s firewall, has a set of zones, which basically enables to configure trusted network connections inside these zones. You can read more about FirewallD on it’s wiki page.

Whenever I bring up a Vagrant box for the first time, Fedora’s firewall blocks the NFS shares, because the new Vagrant network interface does not belong to any zone. The usual symptom of this is that Vagrant gets stuck on the mounting NFS shares step.

I have a zone called FedoraWorkstation that I use for all the Vagrant boxes I have on my laptop. This zone has a list of services that are allowed:

robert@odin ~$ sudo firewall-cmd --zone FedoraWorkstation --list-services
dhcpv6-client rpc-bind nfs mountd ssh samba-client

You can use any other zone you like, but you need to have the rpc-bind, nfs and mountd services allowed for that zone.

After bringing up the Vagrant box, we need to figure out what’s the name of the new Vagrant interface and add it to the firewall zone. Vagrant interfaces follow the naming schema of vboxnetX where X is a number:

robert@odin ~$ ip link show | grep "state UP" | grep "vbox"
7: vboxnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000

From this we can see that the name of the interface is vboxnet3.

Let’s add it to the FedoraWorkstation zone and reload:

robert@odin ~$ sudo firewall-cmd --zone FedoraWorkstation --add-interface vboxnet3 --permanent
success
robert@odin ~$ sudo firewall-cmd --reload
success

Finally let’s make sure that the interface was indeed added:

robert@odin ~$ sudo firewall-cmd --zone FedoraWorkstation --list-interfaces
vboxnet3 vboxnet2 vboxnet0

And that’s it. Happy hackin’!

Tags: configuration, fedora, firewall, vagrant.
Categories: Development, Software.

Installing Python2 with Ansible

by Robert Basic on June 29, 2016.

Ansible uses Python2 to run the provisioning commands on the host machines. At this time it does not support Python3, which is the default python version in Fedora releases for quite some time now.

So to be able to manage Fedora machines with Ansible, I need to install Python2, but how to install it when all the Ansible modules depend on Python2 being installed? Turns out it’s quite simple, by turning of the gathering of facts in Ansible and using the raw module to install the required packages:

- hosts: all
  gather_facts: no
  become: yes
  tasks:
    - name: Install python2 and python2-dnf
      raw: dnf -y install python2 python2-dnf
    - name: Gather facts
      setup:

Just remember this needs to be the very first thing that happens on all your Fedora hosts. After python2 is installed, gather the facts for all the hosts by running the setup module.

Happy hackin’!

Tags: ansible, fedora, provisioning, python, vagrant.
Categories: Development, Software.

Configuring the trackpad and touchpad behaviour for Thinkpad T540p on Fedora 21

by Robert Basic on December 22, 2014.
Heads-up! You're reading an old post and the information in it is quite probably outdated.

This is the last post about the Thinkpad and Fedora. At least for a while. Promise.

With the new generation of Thinkpads, Lenovo decided to change the touchpad. They removed the 5 physical buttons from the touchpad area and left us with one bigger touchpad. To click anything it’s now either touch click (two-finger click for right clicks) or one can push the entire touchpad down, the clickpad. The touchpad has different regions for getting left/middle/right clicks. Sort of.

And for the first time I completely agree with reviews on the internet. This thing is horrible.

If you want both the touch and push clicks, forget it. It just won’t be usable how inaccurate this thing is. If the touch click is turned on, it will get in the way of your typing. You forget yourself and do a push click with the touch click enabled? Here’s some double/triple click for you. Just don’t even bother with the touch click, turn it off.

You’re left now with the trackpad and touchpad for movement, and the clickpad for clicks. Again, pain. You push down the touchpad to click aaand… Good luck and I hope you clicked the thing you wanted. Your finger will move, just a little bit and so will the cursor. And here’s the kicker. Touchpad movements can’t be turned off. At least not in a easy and intuitive way.

After quite some time searching the internet for a fix, I found a forum post explaining how to get this thing usable (sadly, I can’t find that post again to link to it):

Section "InputClass"
    Identifier "TrackPad with buttons only"
    MatchDriver "synaptics"
    Option "SoftButtonAreas" "65% 0 0 0 50% 65% 0 0" # emulate right and middle buttons
    Option "AreaBottomEdge" "1" # disable moving but not buttons
EndSection

Save this as 99-thinkpad-clickpad.conf in /etc/X11/xorg.conf.d/. The touch parts of the touchpad are disabled so we have the trackpad for movements and the clickpad for buttons. I just need to tweak the left/middle/right button clicks a bit more, because there are times when I accidentally do a middle click.

Oh, and now there’s no mouse scroll because that’s touchpad only.

Tags: clickpad, fedora, laptop, t540p, thinkpad, touchpad, trackpad.
Categories: Blablabla, Software.