/dev/blog/ID10T

Advertisement

Custom resolution for an Ubuntu Virtual Box guest

• Ubuntu and virtualization • Comments

I’ve encountered this problem more often than I like to admit: I got an Ubuntu or Debian based Virtual Box guest and I’d like to change the resolution of the Desktop to one not being enabled by default. Changing the resolution temporary is easy with cvt and xrandr.

export XRES=1152 \

&& export YRES=864 \

&& xrandr --newmode $(cvt ${XRES} ${YRES}|tail -1| perl -pe 's/^Modeline\ //') \

&& xrandr --addmode $(cvt ${XRES} ${YRES}|tail -1| cut -d ' ' -f2)

But making the change reboot persistent without using those commands in a startup script took me hours of searching the web several times as I have little knowledge with X11, only find parts of the solution and never documented the steps needed on my own… yet.

OverlayFS as Docker storage driver in CentOS 7

• linux, CentOS, and docker • Comments

For now, I was using Docker with devicemapper on my personal servers. As long as I considered Docker an early test, this was okay. But now I want to move some of my personal infrastructure into containers while also building an automatic service discovery environment for further test containers. Thus I wanted to skip to a faster storage driver. You can find a lot of material about Docker storage drivers in the net, there are several, each having its own pros and cons. If you want to read more into the issue, check the end of the post.
I decided to use OverlayFS for several reasons, integration in the Linux kernel since 3.18 (in combination with a rename to simply overlay) being the major one. Here’s what I needed to do.

Multi monitor wallpapers in Ubuntu

• linux and ubuntu • Comments

Using Linux as your main OS takes some time getting used to when you came from Windows. The way is also plastered with little obstacles and annoyances you can either decide to ignore or solve one after another. One of those small annoyances I recently solved after a couple of years of willful ignorance was an easy way for multi monitor wallpapers on Ubuntu.

I’m using two monitors with different resolutions. DVI-0 uses 1280x1024, DVI-1 uses 1920x1080. Until now, having a nice dual screen wallpaper on my Ubuntu wasn’t possible. It always looked ugly.

Dual monitor wallpaper before

Notice how much black bars I do have here despite the wallpaper having a resolution of 3510x2550, being larger than both of my screens together. The image scaling in Unity is just unsatisfying.

Installing Steam in Ubuntu

• linux and ubuntu • Comments

I had and still have some issues with Steam on Linux. I wanted to use my native system libraries instead of the ones Steam includes. This is a native feature for Steam. Just start Steam with STEAM_RUNTIME=0 set and you’re good to go. At least in theory. Sadly Steam uses a lot of 32-Bit libraries which are not installed on the average 64-Bit Ubuntu. I wrote a small script to solve this problem:

#!/bin/bash
set -x
set -e
set -o pipefail

cd ~/.local/share/Steam/ubuntu12_32/
for INSTALLME in $(LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" \
  ldd $(file *|sed '/ELF/!d;s/:.*//g')| grep 'not found'|sort| \
  uniq|sed 's/^[ \t]*\([a-z0-9.-]*\).*/\1/'|apt-file search -f -| \
  head -1|cut -d ' ' -f1)
do
  ALLINSTALL="${ALLINSTALL} ${INSTALLME}i386"
done
sudo apt-get update
sudo apt-get install ${ALLINSTALL}

Keep in mind that this script doesn’t always chose the best solution, so read the apt-get install message carefully. In my case some libraries were found in the i386 packages of Thunderbird and Firefox leading to an attempted uninstall of the x86_64 Bit versions. In this case you probably need to resolve the dependencies yourself. Additionally, my Steam installation depended on libudev.so.0 which isn’t available on Ubuntu 15.10 (and, as I read on the internet not on 14.04 either). You need to install this manually:

cd /tmp/ && wget http://mirrors.kernel.org/ubuntu/pool/main/u/udev/libudev0_175-0ubuntu9_i386.deb \
&& sudo dpkg -i libudev0_175-0ubuntu9_i386.deb && rm libudev0_175-0ubuntu9_i386.deb

Afterwards I was able to start Steam with STEAM_RUNTIME set to 0. Next stop: Dual monitor problems in several games.

Mosh problem in CentOS 7

• linux • Comments

While setting up a new server, I encountered a problem with mosh. If you don’t know mosh, it’s an extension to SSH which (among other features) enables instant reconnections after an internet shortage. This is especially useful if you’re frequently connecting via mobile network and constantly lose your mobile Internet connection.

However, the problem I encountered was a simple one: Mosh didn’t work. Despite opening (and testing) the needed UDP ports in IPtables the server didn’t spawn properly. After a bit of debugging I found the error while running the mosh server in verbose mode:

[[email protected] ~]$ mosh-server new -v

MOSH CONNECT 60002 kEK45q7SdtGfP00Op+9Nmw

mosh-server (mosh 1.2.5) [build mosh 1.2.5]
Copyright 2012 Keith Winstein <[email protected]>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 17023]
[[email protected] ~]$ forkpty: Operation not permitted

The “forkpty: Operation not permitted” message is the problem indicator. I have yet to find why this happens, but the solution is simple. Just add the user on the server you want to use mosh with to the tty group, e.g. usermod:

usermod -aG tty my_mosh_user

Afterwards you should have no more issues moshing into the server.

Advertisement