Monday, March 23, 2015

Mount drives on startup by editing /etc/fstab


  • Say, you want to mount a NTFS drive located on '/dev/sda2' at '/mnt/nt' on startup with your username and group. 
  • First find your user-id and group-id by using the command "id" in a terminal.
  • Say your user-id and group-id are both 1000, then the line in '/etc/fstab' will be the following:
/dev/sda2 /mnt/nt    ntfs    defaults,uid=1000,gid=1000,rw    0    0

Tuesday, March 17, 2015

VirtualBox RDP

Shell Script to setup username and password for RDP connection to VirtualBox VM.

#!/bin/bash
Proj=$1
User=$2
Pass=$3
Hash=`VBoxManage internalcommands passwordhash $Pass | awk {'print $3'}`
VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
VBoxManage modifyvm $Proj --vrdeauthtype external
VBoxManage setextradata $Proj "VBoxAuthSimple/users/$User" $Hash

Run the script with 3 arguments - Project, Username, Password

To Remove an user from RDP login,
VBoxManage setextradata $Proj "VBoxAuthSimple/users/$User"

After setup, to connect via RDP to a VirtualMachine, use the following command:
rdesktop-vrdp remotehost:3388 -u UserName -p PassWord