The Virtualbox post

Mainly to myself, my repository of tips and tricks of running Virtualbox under Linux. Feel free to use at your own risk.

Configuration location


Connected USB devices not showing up in the usb filter
Check, and add your user to vboxusers group

sudo usermod -a -G vboxusers $USER

Running Guest OS with different date time than Host OS
This is really useful to run old software with time limitations without messing up with the Host OS date/time settings.

It’s easy to specify a time offset from the Host OS in microseconds. 

First get the vm name

VBoxManage list vms

Secondly apply the desired offset (example -1 year clock).

VBoxManage modifyvm "name in vm list" --biossystemtimeoffset -31536000000

(1y = 365d * 24h * 60m * 60s * 1000m)

Linux snapshots – apt-btrfs-snapshot

Since a couple (half dozen) of years I have been using the beautiful KDE Desktop in the very well made and supported Kubuntu distribution. As technology progresses and the switch on desktop computers from fast spinning disks to solid state disks is being made, I sleep better at night with a SSD… and if even SSDs can eventually fail (as Linus Torvalds knows…), you should always backup or cloud your important data, so I was much more worried by a system messed up with some update/upgrade or my own incompetence than trough hard drive failure.

So it was time to try snapshots in Linux. As always in Unix land there’s more than one way to cook an egg. You can go with LVM + classical File System, ZFS or Btrfs (and surely many other options). I did a new Kubuntu installation with the installer defaults using Btrfs as the file system (wanted to test drive Btrfs anyway) and from here is very simple to implement snapshots.

First thing, make sure that you have the default Btrfs setup

# btrfs subvolume list /
ID 257 gen 97520 top level 5 path @
ID 258 gen 97520 top level 5 path @home

Install apt-btrfs-snapshot

# apt-get install apt-btrfs-snapshot

And check that snapshots are supported

# apt-btrfs-snapshot supported

Here actually I get an error the first time i ran it

# apt-btrfs-snapshot supported
Traceback (most recent call last):
File "/usr/bin/apt-btrfs-snapshot", line 92, in
apt_btrfs = AptBtrfsSnapshot()
File "/usr/lib/python3/dist-packages/", line 113, in __init__
self.fstab = Fstab(fstab)
File "/usr/lib/python3/dist-packages/", line 76, in __init__
entry = FstabEntry.from_line(line)
File "/usr/lib/python3/dist-packages/", line 49, in from_line
return FstabEntry(*args[0:6])
TypeError: __init__() missing 3 required positional arguments: 'mountpoint', 'fstype', and 'options'

this was caused by unsupported fuse syntax entries in /etc/fstab, just had to change
sshfs#user@host:/path/ /mountpoint fuse options 0 0
user@host:/path/ /mountpoint fuse.sshfs options 0 0

and it will work. From now on the system is pretty much autonomous, every time you apt-get upgrade a snapshot will be made for you. Take notice that each snapshot is relative to root only, this means that /home is excluded, we are taking snapshot of the system not user files and configs…

# apt-btrfs-snapshot list
Available snapshots:

or you can force a new snapshot

# apt-btrfs-snapshot snapshot

to rollback, just issue

# apt-btrfs-snapshot set-default @apt-snapshot-2014-12-18_19:57:02

and reboot, yeah… fuckin awesome!

Note, i noticed some problems in apt-btrfs-snapshot to delete and list some of own snashots. Probably because of updates in btrfs or apt-btrfs-snapshot itself (pretty common after a distribution upgrade). The delete command doesn’t works as expected and btrfs gives also error. The situation is like this:

You see the snapshot in the list:

#btrfs subvolume list /
ID 257 gen 361392 top level 5 path @
ID 258 gen 361392 top level 5 path @home
ID 505 gen 361392 top level 5 path @apt-snapshot-2015-11-12_13:01:23

But when you go to delete it, btrfs spits an awful ERROR: error accessing…

btrfs subvolume delete @apt-snapshot-2015-11-12_13:01:23
Transaction commit: none (default)
ERROR: error accessing '@apt-snapshot-2015-11-12_13:01:23'

But the solution it quite simple, just mount all the btrfs device and delete it by path:

#mount /dev/sda1 /mnt/
# ls /mnt/
drwxr-xr-x 1 root root 78 Nov 12 13:01 ./
drwxr-xr-x 1 root root 244 Ago 4 12:30 ../
drwxr-xr-x 1 root root 244 Ago 4 12:30 @/
drwxr-xr-x 1 root root 244 Ago 4 12:30 @apt-snapshot-2015-11-12_13:01:23/
drwxr-xr-x 1 root root 40 Fev 7 2015 @home/
# btrfs subvol delete /mnt/@apt-snapshot-2015-11-12_13\:01\:23/
Transaction commit: none (default)
Delete subvolume '/mnt/@apt-snapshot-2015-11-12_13:01:23'
# cd /
# umount /mnt

even so, sometimes when you try to manual delete like above you get an

ERROR: cannot delete ‘/mnt/@apt-snapshot-2015-11-12_13:01:23’: Directory not empty

in this situation just dig a bit deeper

#cd /mnt/@apt-snapshot-2015-11-12_13:01:23
# rm -rf *
rm: cannot remove 'var/lib/machines': Operation not permitted
# subvol delete /mnt/@apt-snapshot-2015-11-12_13:01:23/var/lib/machines/
# subvol delete /mnt/@apt-snapshot-2015-11-12_13:01:23/
# cd /
# umount /mnt

You can thank me later

My bite on Apple

Love it or hate it, it’s the kind of company that leaves no one indifferent. It showed the world (at least to the masses) the personal computer, the graphic interface, the decent portable music player, a real smartphone and what a tablet should be like. All very nice and disruptive. All products are incredible well made, beautiful design and taste, and they just work out of the box like no other in the market. I should love it. But the sad true is i don’t.

Company culture runs top down, and Steve Jobs was indeed a visionary and incredible smart person, but also a manipulative, control freak, indifferent to his own child’s, cruel kind of person (probably a big jerk). Unfortunately a lot of that spilled over to Apple.

Lot’s of (unnecessary) proprietary stuff.
Long story of conflicts with other companies and standards. Adobe, Google, just to name a couple.
Closing the market with all kind of patents and legal tricks.
Mac OS X has a huge portion of FreeBSD on it but i don’t see a cent donated by Apple (list of donors include Cisco, Google, Juniper, NetApp, McAfee, Dell, etc).
I see Google doing some incredible work at a social level, Google foundation, X-Prize. In counterpart is there an Apple foundation?
One buys an Iphone/Ipad and must pay a developer account or jail brake. The SDK is only available for Apple computers.
One must get his OWN files to his OWN device trough Itunes…

And the list goes on and on… does the profit, a vision, or whatever justify this kind of policies? Do the ends justify the means? For Steve Jobs sure, for Apple sure, but not for me. So me choices are rather obvious (check here, here and here).


One more thing 🙂 … it’s kind of sad that all those geeks that were upset some ten years ago by Microsoft monopolistic actions and autism, most of all switched to Apple, giving their love and support to an even worse company in that matter. You can get in a meeting with IT staff and 90% of those that were running Windows laptops some years ago now proudly show their Apple gear… talk about brainwash… i can only recall the old Apple motto “Think different”… probably will glue this to my Linux laptop one of those days.

Linux – upgrade to Kubuntu 11.04 “Natty Narwhal”

Just finished a laptop upgrade of Kubuntu (the Canonical Linux flavor) from distribution 10.10 to the latest 11.04″Natty Narwhal”. As usually my system was pretty messed up, and it take a couple of hours to put everything in working status. Anyway, the pain pays off and i really enjoy more and more to work with it, some of the key benefits are just awesome:

  • It’s free
  • It’s fast
  • The install/uninstall/upgrade software system is perfect, with thousands of free apps just a click away
  • The really beautiful KDE user interface

    It’s funny and kind of sad to walk into a room with 20 people, 15 of which running the “Think Different” computers, then boot up your laptop with Kubuntu…

  • The full freedom to customize and configure your OWN machine
  • The excellent fuse “mount everything” that you think of sub-system

There are still some problems that make it hard for non-geek users to embrace Linux on their desktops and laptops, even on the user friendly distributions (like Kubuntu). At least for me the major upgrades are nothing short of chaotic, some drivers support is still flaky and buggy (3d on ATI for me the worst by far), here and then there are some regressions with stuff unexpectedly stopping working good.

But the Linux community should be very proud, because the system has done such a long way. I still remember when just installing was some kind sorcery, not to speak in starting a graphical windows system (xorg.conf test #383). Or more recently support and configuration of wifi cards/networks/authentication nightmare. All of this is now gone, for instance last week i was able to configure VPN access and get 3G Internet via USB dongle just using the network manager GUI, no black screens, no bash, no googling…. simply amazing… – take that Windows – and then mounting remote filesystems with only one command – take that Apple.

So, is Linux perfect? Of course not.
Would i install it my friends computer? Maybe.
Am i willing to pay for Windows or OSX with Linux as a free alternative? Of course not.