Saturday, March 14, 2015

Setting up a shared drive with my VirtualBox Guests

  1. Oracle VM VirtualBox
  2. Your Host can be any OS
  3. The Guest can be any version of Microsoft Windows (98, XP, Vista, 7, etc.). I used Windows XP.
Now you can follow these steps:

Step 1 

Run your Host OS and launch VM VirtualBox.

Step 2 

Start your Guest OS in which you want to share drives/folders and files contained in them.

Step 3 

Click on "Devices" tab provided on the VM VirtualBox taskbar and select "Shared Folders" from the drop-down list.

Step 4 

VirtualBox will open a window "Shared Folders". Click on the top icon in the right-hand corner to add the drive/folder. Another window will open—"Add Share".

Step 5 

"Add Share" allows you to give the path of the drive/folder you wish to share from the Host OS by giving the path in "Folder Path". You can also browse the drive/folder from your Host OS if you don't remember the exact path of the contents you want to share.

Step 6 

Now type the name of the folder in the "Folder Name" box. It can be any name you wish to have on Guest OS. Also, check the boxes "Auto Mount" and "Make Permanent" and click "OK".

Step 7 

Go to "Start", select and click "Run" on Guest OS. Type "net use x: \\vboxsrv\Drive F" as the run command and click "OK". If you have done everything alright, then no message or notification will appear. Note that the shared drive/folder name should be the same as given in the "Share Folder" window from Step 6. I gave it "Drive F".

Step 8 

Go to "My Computer" and there you will see your shared drive/folder under "Network Drives". Now you can access all contents contained in the shared drive/folder that you just shared. You can add as many drives and folders as you want following the same steps.

Monday, January 26, 2015

Backing Up My FreeNAS Server

I run my FreeNAS as a VirtualBox VM, with VirtualBox running on Oracle Enterprise Linux 6.5.    This has created a bit of a stability problem as sometimes the VM will crash or be a victim of a power outage.  Anytime the the VM goes down unexpectedly, there is risk that the virtual drive, VMDK in my case, will get corrupted.  At any rate, backing up your backup is a good DR policy.  I have chosen to use the following strategy:

1.  Use the CRON job process in FreeNAS do an RSYNC between the VMDK drive and my host OS (OEL6.5).  This will get my files out of the VMDK and onto a separate drive mounted on OEL6.5.  RSYNC is feature rich allowing me to copy only files that have been changed.

Here is my RSYNC script on the FreeNAS system:





Since this script will need to automatically login to my host OLE6.5, I'll need to setup passwordless login for SSH.  I do this using the following commands:
jsmith@local-host$ [Note: You are on the guest VMBox FreeNAS system here]
jsmith@local-host$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jsmith/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Pess enter key]
Your identification has been saved in /home/jsmith/.ssh/id_rsa.
Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub.
The key fingerprint is:
33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 jsmith@local-host

Now Copy the SSH Key to my host OEL6.5 keystore:
cat /home/jsmith/.ssh/id_rsa.pub | ssh root@192.168.1.250 'cat >> .ssh/authorized_keys'


2.  Once I get the files onto the OEL6.5 mounted volume, I use CrashPlan to upload the files into the CrashPlan cloud.  CrashPlan has a nice GUI (Java) and is one of the few that supports all platforms, including Linux.  They are also surprisingly economical;  $59/year for unlimited space.

3.  Finally I purchased a CyberPower UPS (CP1350AVRLCD) to protect against surprise outages and to regulate my AC power.  This was a pretty good deal for $125.  This is the only one I could find that has Linux compatible software for shutdown and monitoring.