Restore a Windows Server 2008 RC2 from VMWare VDX file

I have to investigate one of the Domain Controller running Windows Server 2008 RC2 from a Backup VMware folder that contain VDX file. This is a snapshot of running Server from last month from other remote backup Datastore.

Restore a Cloned Virtual Machine

In VCenter go to the Datastore that contain VDX file
Right Click VDX file and register VM with different than the running one. EX: SrvrRecovery
After that change the Datastore from backup to our production Datastore
Now when you fire up the Machine it will have a lot of problem because the disk is Write Protected, Hidden and it has Nodefault Driver Letter so the Boot Procedure will fail. To overcome that

Change the value of the disk.EnableUUID parameter to False: Vcenter -> Host -> SrvrRecovery (PowerOFF) -> Actions -> Edit Settings -> VM Options -> Advanced -> Configuration Parameters -> Edit Configuration -> disk.EnableUUID-> False

Ajust booting flags on Primary Boot Partition

VCenter -> SrvrRecoveryPowerON -> Connect Windows Server 2008 RC2 .iso and boot into it.
Optional: change your network card to other place or temporary disable 
When Host bootup -> Esc -> Boot from CD -> Choose Repair your computer -> Select Command Prompt Option.

diskpart
list volume
select volume 1
attributes volume
attributes volume clear nodefaultdriveletter
attributes volume clear hidden
attributes volume clear readonly
exit

Rebuild Boot Configuration Data

In command Prompt 

bootrec /rebuildbcd
type Y (yes)
exit

After it complete successfully exit the prompt and restart the server 

Yeah man! the Virtual server is coming back

Reference:

How to sync Windows folder to Ubuntu permanent

apt-get install cifs-utils

Mounting unprotected (guest) network folders

sudo mkdir /media/windowsshare

Then edit your /etc/fstab file (with root privileges) to add this line:

//servername/sharename /media/windowsshare cifs guest,uid=1000,iocharset=utf8 0 0

guest indicates you don’t need a password to access the share,
uid=1000 makes the Linux user specified by the id the owner of the mounted share, allowing them to rename files,
iocharset=utf8 allows access to files with names in non-English languages. This doesn’t work with shares of devices like the Buffalo Tera Station, or Windows machines that export their shares using ISO8895-15.

If there is any space in the server path, you need to replace it by 40, for example

//servername/My40Documents

After you add the entry to /etc/fstab type:

sudo mount -a

Mount password protected network folders

The quickest way to auto-mounting a password-protected share is to edit /etc/fstab (with root privileges), to add this line:

//servername/sharename /media/windowsshare cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0

This is not a good idea however: /etc/fstab is readable by everyone and so is your Windows password in it. The way around this is to use a credentials file. This is a file that contains just the username and password.

Using a text editor, create a file for your remote servers logon credential:

vi ~/.smbcredentials

Enter your Windows username and password in the file:

username=msusername
password=mspassword

Change the permissions of the file to prevent unwanted access to your credentials:

chmod 600 ~/.smbcredentials

Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):

//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

Save the file, exit the editor. Finally, test the fstab entry by issuing:

sudo mount -a

If there are no errors, you should test how it works after a reboot. Your remote share should mount automatically.

Special permissions

If you need special permission (like chmod etc.), you’ll need to add a uid (short for ‘user id’) or gid (for ‘group id’) parameter to the share’s mount options.

//servername/sharename /media/windowsshare cifs uid=ubuntuuser,credentials=/home/ubuntuuser/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

Sync Localdir with Sharedir

rsync -avz /media/windowsshare/ /var/www/app/img/

Sync every 5 minutes

su – www-data
crontab -e
* 5 * * * rsync -avz /media/windowsshare/ /var/www/app/img/ > /dev/null 2>&1

https://wiki.ubuntu.com/MountWindowsSharesPermanently

Happy Children day

Happy Children day

I like those eyes, I’m happy to see those emotions. Mom/Dad and Son/Daughter… Life is awesome! 
First shoot was completly out. But I love it the most