martedì 17 dicembre 2013

Guacamole Appliance 0.8.3: plug and play HTML5 remote desktop gateway virtual appliance (KVM, VirtualBox or vmware)

Guacamole is an HTML5 remote desktop client/gateway that allows you to access your RDP/VNC/SSH servers from any modern browser (you don't need any remote desktop client, vnc, vpn software installed on the client).
Check it out on official page:

This appliance is based on ubuntu 12.04 server 64 bit and uses the "virtual" kernel (optimized for virtual guests) it comes in RAW format and is 7zip compressed (10 Gb uncompressed size).
You can run it in KVM or import into Virtualbox, or convert it in vmdk and run it in some vmware or whatever... no guest tools installed so you may take care to install the proper ones depending on the virtualization platform you'll use (this is completely optional).

Get it!

Download the appliance:

 Guacamole Appliance 0.8.3 - Download
size:  968 MB
md5: 10d6ab2b3475dbe74b26eeac3db07095

unpack it using 7zip (is at highest compression level so it may take a while):
7za e guacamole-appliance-

Convert it! (if needed)

If you don't use KVM you may have to convert the RAW image to another format (you have to have VirtualBox to do so):
Converting it in VDI (VirtualBox format):
VBoxManage convertfromraw guacamole-appliance.img guacamole-appliance.vdi  --format VDI
Converting it in VMDK (vmware format):
VBoxManage convertfromraw guacamole-appliance.img guacamole-appliance.vmdk  --format VMDK
If you want to convert it into a compressed QCOW2 (to save space on your KVM host, as this not supposed to be an heavy duty database machine you can opt for compressed QCOW2 without performance impact) you can do the following:
qemu-img convert -c -f raw -O qcow2  guacamole-appliance.img guacamole-appliance.qcow2

Run it!

Import it in your virtualization platform and run it (as linux 64 bit guest)!
Log in to your virtual appliance with the default user (that is a sudoer, of course)
user: guacadmin
pass: guacadmin

Secure it!

change login password:
change mysql root password:
mysqladmin -u root -p'guacadmin' password 'yournewpassword'
change guacamole's mysql password:
mysql -u root -p
then in the mysql shell:
SET PASSWORD FOR 'guacamole'@'localhost' = PASSWORD('yournewguacamoleuserpass');
then adjust the guacamole configuration file
sudo nano /etc/guacamole/
and change the last line updating the password:
mysql-password: yournewguacamoleuserpass
restart tomcat6 service to apply the password change for guacamole server:
sudo service tomcat6 restart

Find where to connect!

check your IP (DHCP enabled by default):
ip a
If you want you can set a static ip:
TIP: Maybe you want to do a nice port forward on your router: point TCP port 8080 to your guacamole-appliance to access from outside your network (this comes handy if you have a static ip or dynamic dns setup!)

Use it!

open a browser and go to: http://guacamole-appliance-IP:8080/guacamole
login with default credentials
user: guacadmin
pass: guacadmin
click "Manage" button on top right, click on guacadmin user and change the password.

Enjoy your shiny HTML5 remote desktop gateway!

how to use Guacamole:

venerdì 19 luglio 2013

[How-To] Update BIOS on DELL Laptops/Desktops/Servers running Linux (4 steps)

I came through this issue:

Called TechSupport for an issue on my Latitude E6430 (running ubuntu, and bought with ubuntu from DELL).. they told me to update BIOS to last revision in order to solve my issue. But, big surprise: there's no linux update package, nor a bootable usb something to do this, just a good old .EXE file.

I tried running it with wine, but no success (and a bit of fear in doing it too), vitual machines were not suitable because of hardware abstraction, I didn't want to install windows on my laptop just to update the bios, so I share this solution with you:


Download Hiren's Boot CD and burn it on a CDROM. download from here:
if your pc/laptop/server has no CDROM drive you can use this trick to boot from USB (tried with unetbootin but it does not work, so follow these steps from windows machine virtual or phisical)


Download your bios update file from DELL support site, usally named MODEL#REVISION#.exe (eg: my file was called E6430A11.exe) and place it on a FAT formatted usb drive in order to access it from Hiren's Boot CD


Boot your pc/laptop/server from Hiren's Boot CD and select the "Mini Windows XP" option. It will boot in a sort of Windows environment.


Plug your USB stick with the BIOS update .exe and run it directly from Windows Explorer in the Mini Windows XP environment.
The package will run, unpack the bios image, reboot your pc and bring you to the BIOS update process. Lay down a couple of minutes and relax watching your BIOS being updated.

Enjoy and let me know if it helped

*note: to start the BIOS update you have to plug the AC adapter of your laptop and ensure that your battery is healty and over 50% of charge. For desktops and servers is best to do this behind a UPS battery to be shure not to screw your motherboard.

domenica 3 febbraio 2013

How-To install Linux Mint Debian Edition on Btrfs using subvolumes (only 5 steps, MAY work on ubuntu too!)

This post will guide you through the installation of LMDE on Btrfs filesystem.
The goal is to have an high performing filesystem under you installation with the ability to take live snapshots of both your / and your /home folders in an independent way so you can rollback your system or data just by defining wich snapshot you want to use.
NOTE: this may work on ubuntu too (anyway check to have btrfs-tools installed first)

STEP 1: Create partitions and install system

Boot from LiveCD and define a swap partition and a btrfs partition (in this tutorial will be swap=sda1, btrfs=sda2):

Install LMDE normally and do NOT reboot at the end.

STEP 2: Mount Btrfs and create subvolumes for / and /home

Open terminal and create a mountpoint and mount btrfs volume:
sudo su
mkdir /mnt/btrfs
mount /dev/sda2 /mnt/btrfs/ 
Create two subvolumes (one for / and one for /home):
/sbin/btrfs subvolume create /mnt/btrfs/root-sub
/sbin/btrfs subvolume create /mnt/btrfs/home-sub

STEP 3: Move installation to the root-sub and home folders to the home-sub subvolumes

Then you have to copy all the installed system under the root-sub subvolume:
rsync -avz --exclude=root-sub --exclude=home-sub /mnt/btrfs/ /mnt/btrfs/root-sub/
wait till is done (5-10 minutes maybe).
Copy the home folder to the home-sub subvolume:
rsync -avz /mnt/btrfs/home/ /mnt/btrfs/home-sub/
this will take just a few seconds (only few config files there) then you can erase all the directories in the btrfs root volume (in order to keep just the one you've copied into root-sub):
cd /mnt/btrfs/
rm -r !(root-sub|home-sub)

STEP 4: Define default subvolume for /

Now you can set a default subvolume to be mounted when the device is called for mounting, in our case will be root-sub (this makes GRUB able to access directly our root-sub without modifyng default grub options).
You can check the subvolumes IDs:
/sbin/btrfs subvolume list /mnt/btrfs/
you get an output similar to this:
ID 257 top level 5 path root-sub
ID 258 top level 5 path home-sub
now set the root-sub subvolume (check your ID, in this case it is 257 for root-sub, not shure that can be the same for you, anyway..):
/sbin/btrfs subvolume set-default 257 /mnt/btrfs/  

STEP 5: Set /etc/fstab to mount subvolumes correctly

We are now going to disable the fsck at boot because at time of writing is still under heavy development, so I think that can be risky to set it automatically at boot, and moreover there's a missing symbolic link that will stop boot process.
So let's modify the fstab of your newly installed system:
pluma /mnt/btrfs/root-sub/etc/fstab
modify the line where / mountpoint is defined (usually the last line in the fstab file) by replacing the last "1" (pass) with a "0" to disable fsck at boot, it has to look like this:
# /dev/sda2
UUID=xxxx_whatever_xxxxxx    /    btrfs    defaults    0    0
then add a line to mount the home-sub subvolume in /home folder:
# home subvolume
/dev/sda2    /home    btrfs    defaults,subvol=home-sub    0    0
Save and close.

NOTE: you can use UUID if you prefer just copy it from the line where / mountpoint is defined

Enjoy Btrfs!

And... yes, you're good to go: you can reboot and enjoy your Btrfs powered LMDE installation, now you have 2 different subvolumes for / and /home and you can take indipendent snapshots.

Here some commands you may need:

  • to create a / snapshot:
    sudo btrfs subvolume snapshot / /root-snapshot-1
    or an /home snapshot:
    sudo btrfs subvolume snapshot /home /home/home-snapshot-1
  • to delete the snapshots:
    sudo btrfs subvolume delete /root-snapshot-1
    sudo btrfs subvolume delete /home/home-snapshot-1 
  • to list all subvolumes and snapshots in your btrfs:
    sudo btrfs subvolume list /
  • to set a new default snapshot for root (if you want to rollback your system) you have to set:
    /sbin/btrfs subvolume set-default XXX /mnt/btrfs/  
    where XXX is the ID of the snapshot (you can check it by listing the subvolumes as described in previous point), then reboot
  • to roll back (hardcore way) your home folder you have to choose the snapshot name (not ID) by listing it and set the correct mount option in /etc/fstab using:
    where XXXXX is the volume name, in the case of the home snapshot we took in this example (just few lines above) the line in /etc/fstab will be:
    /dev/sda2    /home    btrfs    defaults,subvol=home-sub/home-snapshot-1    0    0

Tuning tips

  • To force transparent compression on all managed files, in order to increase your usable storage space and increase write/read performance, you can use this mount option
  • If you are on SSD drive you may want to enable discard/TRIM to mantain r/w performance over time by clearing to 0 the deleted blocks. You just add this other mount option:
  • If you are running kernel 3.2 (or newer) and you use a single SSD drive (not playing around with mixed devices and RAID array) the following mount options can be used to improve performance (ssd,space_cache,noatime,compress-force=zlib), mantain performance over time (discard), reduce fragmentation (ssd_spread) and enable autorecovery upon mount (recovery):
An example of fstab line to enable compression and TRIM on the /home subvolume:
/dev/sda2    /home    btrfs    defaults,subvol=home-sub,discard,compress-force=zlib    0    0