Hint of the day: @digitalocean and not mounting sshfs at boot

In /etc/fstab, be sure to add the option:


As it will attempt to start the network mounted sshfs before networking has been started.

The entire line looks like this:

user@host:/some/dir /local/path fuse.sshfs defaults,idmap=user,_netdev  0 0

From the man pages:


The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).

Blog’s back

Yay, after some hardware issues my blog’s back.

Zero had a corrupt reiserfs. Decommissioned the old P4 and replaced by a brand new dual Xeon. Running Xen and Debian instead of Gentoo.

And shortly there after Four (the server that hosts this VM), the Ubuntu host with Xen refused to start its networking, so I decided to start a fresh install (Debian as well this time).

One, who also had a broken hard disk (an old P3) got decommed as well.

Long story short, it’s back!

Xen: iptables issue

vm3:/# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination
WARNING: Could not open 'kernel/net/netfilter/x_tables.ko': No such file or directory
FATAL: Could not open 'kernel/net/ipv4/netfilter/ip_tables.ko': No such file or directory
iptables v1.4.2: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


vm3:/# depmod
vm3:/# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination

All ok 🙂

Xen: PTY allocation request failed

$ ssh vm3.rootspirit.com -l root
root@vm3.rootspirit.com's password:
PTY allocation request failed on channel 0
stdin: is not a tty

Kill the DomU (xm console *might* work, but somehow rarely works for me).

mkdir /tmp/disk
mount /path/to/disk.img /tmp/disk
chroot /tmp/disk /bin/bash

=> in chroot env

nano -w /etc/fstab

And add (though this is probably not needed):

none            /dev/pts      devpts    defaults        0   0

And install udev:

apt-get install udev

Clean up, and restart DomU

umount /tmp/disk
xm create /path/to/xen/vm.cfg

Should do the trick. 🙂

Xen: Failed to find an unused loop device

I had to start a new Xen domU this afternoon,

xm create vm#.domain

But this resulted in following error:

Error: Device 5632 (vbd) could not be connected.
Failed to find an unused loop device


Create /etc/modprobe.d/local-loop.conf with this content:

options loop max_loop=64

Turn off all DomUs, yes, bummer. You’ll need to reload the loop module which won’t work if Xen is still using them. xm list should only display Domain-0.

modprobe -r loop && modprobe loop

And restart all DomUs. You can now create 32 (64/2 ~= # of DomUs; increase if you need more) DomUs.

You can check (before & after) the difference in loop back devices: ls -ls /dev | grep loop | wc -l