domenica 11 ottobre 2015

HOWTO: Moving a Windows (XP) installation from a broken PC to a new one... using Virtualbox.

Move one hard disk from a broken PC to a new one, usually, does not suffice in order to get back our OS installation; the problem is the lacking of pre-installed drivers for chipset and peripherals (the new PC ones) that prevents the system boot.

Few days ago my father's motherboard broke. I had no time to: install a new operating system and reconfigure tons of programs,I decided to try a desperate recover of the old installation.

And.. I had an idea.

Using virtualbox in order to boot up my father's OS and prepare the old installation to the migration to the new hardware; I hoped that the old OS already had the drivers for the old emulated hardware.
In order to boot the old installation, Virtualbox can use a physical device like virtual device for a virtual machine, this is not a well known feature.

The Performed Task

I recovered the old windows XP SP3 installation, moving it from a broken Asus k8n motherboard, equipped with Athlon x2 4200+, to an Asus p5n-d with Core2Duo Q9300.
The system hard disk was a 1TB WD green model.
The Virtualbox system host was my mighty laptop, equipped with the Intel 4720HQ CPU, and Linux Mint operating system.

The Procedure

I'll refer to my laptop as PC-host.


  • Take out the system hard disk (HD) from the broken PC
  • Connect HD to PC-host (for example via an external USB adapter)
  • Find out the assigned HD device name: dmesg or fdisk -l  linux commands (in my case it is /dev/sdb)
  • Mount the HD partitions and backup the data
  • Unmount the  HD partitions (mandatory)
  • give device access to the virtualbox user (for example via chmod 777 /dev/sdb)

Virtual machine setup

Create a new Windows XP (32bit) virtual machine(VM), but do not create ANY virtual disk, configuration details:
  • Chipset PIIX3
  • 2GB RAM
  • I have forgotten I/O APIC On, but I think this has no effect with winXP
  • Network NAT, PCnet-FAST III (Am79C973)
  • Pointing device: PS/2 Mouse
Create a virtual disk that connects to the block device:

This example is for my use case, Linux operating system and HD device /dev/sdb

VBoxManage internalcommands createrawvmdk -filename "myFatherDisk.vmdk" -rawdisk /dev/sdb

Add myFatherDisk.vmdk virtual device to the VM (you do it in the Virtualbox storage panel)

Recover and prepare OS

  • Boot the VM
  • Press F8 during boot in order to enter Safe Mode
  • Wait device driver installation to complete
  • Reboot
  • The VM might work fine, let's skip windows genuine registration
  • let's download the new motherboard/device drivers (in my case from ASUS page)
  • install the new drivers into VM
  • Disconnect HD from PC-host
Untested: you can also try disabling the WPA to avoid problems during migration, I think you can re-enable later. Or you can find a solution by your own (please read the next section about).

At this point you have the old OS already working as VM inside a new hardware (PC-host).

Move the HD to the new hardware

  • Connect HD to the new motherboard
  • Boot from HD
  • Press F8 during boot in order to enter Safe Mode
  • My case: Windows genuine activation request prevent you from proceeding and installing drivers; usb devices are not working yet, you need a connected ps2 keyboard in order to skip activation(*)
  • Wait device driver installation to complete
  • reboot
  • Clean installation, reinstall broken software (I reinstall video driver, just in case), install secondary lacking drivers, clean registry (for example via CCleaner)
  • Reboot few times :-D
  • Activate your windows
My father's new PC is ready!


I was unable to skip the windows genuine activation when booting with the new hardware, this prevents the driver installation.
In order to skip it you need a working keyboard or mouse, but the new USB hub device is not initialized, yet.
Luckily I had an old ps2 keyboard and the motherboard connector.

There may be alternative (untested) solutions:
  • you can force the hardware device initialization first, by using the sysprep windows utility.  A possibile solution, may be using sysprep before disconnecting HD from PC-host and connecting to the new hardware. I have not deepened this road. Please refer to the instructions of the  syprep utilty.
  • Disable  windows genuine activation service, and re-enable it later.

In the event that you have a smarter solution to this problem, please share it with me.

Have fun



giovedì 6 agosto 2015

Alita - Gally - Gunnm Motorball wallpaper (16:9)

Alita-Gunnm- is one of the best manga characters ever.
I was not able to find out a decent 16:9 Alita wallpaper, so I forged a very nice 4:3 wallpaper to 16:9.
I hope you'll like this extended version.
I have modified a wallpaper that was floating around for a while,I have found the original artist with an image search: the Benlo original paint is on devianart.

Download the wallpaper here:

sabato 6 giugno 2015

NFS over OpenVPN over ADSL(or slow connection), best settings

In recent years I have often used NFS shares through OpenVPN, with a 7Mbit ADSL connection, and I have always faced a great slowness in directory listing (takes a lot of seconds to do ls or update the file manager view) and file transfers.
For the sake of completeness, I'm using Linux Mint 17.. it's a Debian like distro.

I have read lot of posts and I have tried the reasonable subset of suggested solutions, I'm going to provide a configuration walkthru; this is the summary of the best tips:
  • use a NFS packet size smaller than littler MTU size (default is 8Kbytes, new values should be littler than 1500bytes, few guys suggest 1024bytes)
  • use NFS TCP connection type; do not use UDP on ADSL/WANs
  • use the NFS async option
  • do not set very small timeouts, left the default 60 secs (timeo=600) or.. I have tried with success 10secs (timeo=100) too
  • with the hard mount option, let's add the intr option

For linux users,  here is a little fstab configuration example for soft mounts:

servername:/shared/     /mnt/foldername/  nfs     rw,suid,dev,soft,exec,nouser,async,noauto,timeo=100,user,rsize=1024,wsize=1024,tcp 0 0

and here, for hard mounts:
rw,suid,dev,intr,exec,nouser,async,noauto,timeo=100,user,rsize=1024,wsize=1024,tcp 0 0

I have also used rsize/wsize = 1350.
These findings have been obtained with the typical mambo-jambo, fire&forget, try&see experimental procedure.
  • Yes, I have read the manuals (they suck)
  • yes, I have chosen only the reasonable subset of internet tips
  • yes, I have tried  lots of permutations 
I am far from a statistically significant sample :-).
These changes have improved my NFS usability, doubling the download speed for a single file and raising a lot the browsing responsiveness.
NFS over vpn+adsl is still dramatically slow (at the moment I am transferring files at about 150 KB/sec, and this is far better than without the proposed changes).
Please consider that my 7Mbit ADSL has a download bandwidth of 800KB/sec.

I hope that these tips are going to work in your case too..

Have you find out a better solution? Other magical NFS options? Please share, tips are welcome.
Have fun

lunedì 29 dicembre 2014

TD-W8960N V5, a very good ADSL router

I recently installed a TD-W8960N V5 WiFi-router at my father home.

I am very impressed by its features and performance.

Please note, previously I installed and used the W8960N V2 and W8961N routers.
They worked well; W8960N V2 is superior than W8961N, it has a fair amount of features and available settings.

Both W8960N V2 and W8961N have the usual Tp-link like "rough" web interface, providing lots of low level settings with no clear explanations or guide.

TD-W8960N V5 improves the web interface, respect the older models, the interface is better organized, and adds plenty of very useful features.

The preferred features are:
  • Per-user bandwith throttling-- Yes you can sharp the bandwidth!
  • Guest network-- you can create a separate wireless network for guests (your main wifi network is a totally separated network, if you like)
  • Bandwith throttle the Guest Network
These are features I have long waited for, in the low-price router segment.

I have also noted that the wifi connection, at my father home, is far more stable now (less wifi disconnections or hiccups) respect with the older W8961N.

I hope you find these informations useful.

TD-W8960N V5 Respekt

giovedì 9 gennaio 2014

Trenitalia, no, Cammellitalia

Oggi sono tornato da Vienna inaugurando la nuova fantasmagorica tratta Vienna->Venezia (io dovevo arrivare fino ad Udine, partenza da Vienna circa 6:45 e arrivo a Udine 12:16).
Il tratto Austriaco è andato da favola, tutte le fermate in orario, figurarsi.
Appena arrivati a Tarvisio (si, in Italia) e al "cambio consenga" tra OBB e Trenitalia, la fermata si prolunga.


Ci informano dopo una diecina di minuti che a causa di un guasto al locomotore ci sarà forse un autobus sostitutivo non si sa ne come ne quando; io già da qualche minuto avevo visto comparire gli autobus sostitutivi sugli orari online, naturalmente con orario fasullo 12:53.

L'autobus arriva o forse sarebbe più giusto dire, viene partorito, alle 14:10; nel fratttempo un gruppo ti turisti Austriaci/tedeschi incavolati come bestie avevano già preso un taxi (330 euro) per non perdere un volo a Venezia.

L'autobus arriva a Udine verso le 15:30, stanco e incavolato non voglio lasciaglierla passare liscia e memore del fatto che esiste una indennità di ritardo mi reco allo sportello per chiedere il mio 50% sul costo dei tre biglietti.
L'impiegata è cortese mi spiega come si fa e mi fa compilare i moduli; 
apro parentesi, ora la richiesta di una indennità mi pare una operazione che dovrebbe essere un tantino integrata nel sistema informativo di trenitalia, invece la povera impiegata ha dovuto compilare a mano moduli, fare fotocopie, timabrare, mancava la ceralacca e la cartacarbone.
Detto questo l'impiegata dispiaciuta mi fa notare che questa pratica ci metterà MOLTO tempo.
Un appello a voi viaggiatori: non fategliela passare liscia, per ritardi superiori alle 2 ore avete diritto ad una indennità del 50% del valore del biglietto, lo so che è una rottura di scatole, ma chiedetelo! Questi maledetti ci campano sulla stanchezza della gente e sulla difficoltà e lentezza delle pratiche. Fatevi risarcire

Maledetti maledetti maledetti, non posso scusare la cronicità del ritardo, la mancanza di organizzazione e il coraggio con il quale sdoganano i disagi alla stregua di "un così va il mondo" ; sta gente pensa forse di giocare con i trenini Lima? cavoli, io volevo lavorare questo pomeriggio e non ho potuto, per colpa loro ho perso un pomeriggio di lavoro.

Cammellitalia la dovrebbero chiamare dato che di un compagnia di trasporti africana trattasi.


P.s: se dovete andare a Vienna e potete scegliete, prendete sempre le tratte italiane su Autobus OBB + Treno OBB da Villach, siccome il povero treno OBB quando diventa Italiano di tutte le piaghe paga. Alla larga dalla penisola Africana.

martedì 5 novembre 2013

Making one photo album with two cameras, how to merge the photo sets in a smart way

Coming back from my New York holiday I have had to merge toghether two photo sets, taken with two cameras, into a single photo album.
I 'll provide here a quick walkthru by using the Linux OS and the jhead console command.

About the jhead command installation please use/refer your Linux distro package manager.

When merging photo sets from  two (or more) cameras, you face these problems:
  • different filename conventions for image files
  • different progressive numbers in image filenames
  • camera clocks are not synched
Let's assume you have moved the two photo sets in two folders, /frank and /ann ;
The first step is to fix the clocks delta; you have to find out two shots taken at the same time by frank and ann, let's look for something similar to:

You can use photo A and B in order to calculate the time delta between camera clocks.

Let's open these images with an image viewer and let's read the time/date EXIF informations (usually you have to look at the image "properties").


you can obtain the time/date info by using the  jhead  command from shell, e.g.

>jhead IMG_2337.JPG 

File name    : IMG_2337.JPG
File size    : 3184059 bytes
File date    : 2013:10:10 16:06:04
Camera make  : Canon
Camera model : Canon DIGITAL IXUS 75
Date/Time    : 2013:10:10 16:06:05
Resolution   : 3072 x 2304
Flash used   : No (auto)
Focal length :  5.8mm  (35mm equivalent: 37mm)
CCD width    : 5.72mm
Exposure time: 0.017 s  (1/60)
Aperture     : f/2.8
Focus dist.  : 3.84m
ISO equiv.   : 160
Whitebalance : Auto
Metering Mode: matrix  

Consider this situation:
  1. Ann's photo, foto B,  Date/Time    : 2013:10:10 16:06:05
  2. Frank's photo, foto A, Date/Time    : 2013:10:10 16:16:25 

Frank's clock is 10 minutes and 20 seconds fast, you are going to fix this:

>cd frank
>jhead -ta-0:10:20 *.JPG

This command has fixed the exif time information by decreasing the photos time/date (-0:10:20). The two photo sets are now time-synced.
Jhead command provides other options to easily manage a very big clock delta (days, months or years), please refer to man pages.

The next step is photo renaming, you are going to change the photos filenames with new ones based on their EXIF time/date;
let's use jhead again:

>cd frank
>jhead -n%Y%m%d-%H%M%S-frank *.JPG
>cd ../ann
>jhead -n%Y%m%d-%H%M%S-ann *.JPG

e.g. this is going to rename the ann photo IMG_2337.JPG to 20131010-160605-ann.jpg
Please note the postfix -ann (and -frank), it helps mixing photos with the same time attribute.

Now you can simply move (or copy) the photos into the fresh new /happyholidays folder.

mv /ann/*.* /happyholydays
mv /frank/*.* /happyholydays

I hope this is useful, have fun. :-)

martedì 1 ottobre 2013

PS4 vs Xbox, proiezioni provinciali

Qualche giorno fa sono passato per un negozio di videogiochi a Portogruaro e ho chiesto ad una commessa varie info sulle console; siccome era molto disponibile ho approffitato per chiedere impressioni dietro le quinte, tipo andamento delle vendite etc.. ho scoperto cose interessanti.

  • Entrambe vendono bene
  • Le prenotazioni per la prima ondata sono quasi esaurite, ai ritardatari toccherà aspettare il prossimo anno e anche qualche mese di più
  • A Portogruaro la PS4 vende MOLTO di piu della Xbox
  • La commessa ha una teoria secondo cui le preferenze per una console hanno carattere territoriale locale (*)

(*) Mi spiego, l'idea è questa: i ragazzi tendono a comprare ciò che ha l'amico quindi se una zona è tradizionalmente pro Sony essa tenderà a restarlo, lo stesso vale per le zone Xbox;
secondo il modello proposto le situazioni di equilibrio risulterebbero instabili.

La teoria della commessa prevede che si formino delle città PS4 e delle città Xbox, Portogruaro è decisamente una roccaforte PS4.

Sarebbe interessante verificare..