VirtualBox – Cloning a VM and Hard drive

Cloning a VirtualBox VM+Drive

Step 1) Clone a Disk

in ~/Library/VirtualBox/HardDisks

VBoxManage clonevdi <existing drive> <new drive>

Example

Command

VBoxManage clonevdi WinXP-IE7.vdi WinXP-IE6.vdi

Output

Clone hard disk created in format 'VDI'. UUID: 327deab6-c228-4fdc-93cd-004a45c4fece

Step 2) Create and register an empty VM

The important element here is the ‘register’.

in ~/Library/VirtualBox/Machines

VBoxManage createvm -register -name <new name>

Example

Command:

VBoxManage createvm -register -name WinXP-IE6

Output:

UUID: c43cfacd-8c5f-46ac-9f5a-c6f8d84b6f10
Settings file: '/Users/tflynn/Library/VirtualBox/Machines/WinXP-IE6/WinXP-IE6.xml'

3) Copy the existing setup into the new setup

in ~/Library/VirtualBox/Machines

Example

cp ./WinXP-IE7/WinXP-IE7.xml ./WinXP-IE6/WinXP-IE6.xml

4) Edit the new configuration file

a) Change the Machine Name and UUID

Example

  <Machine uuid="{c43cfacd-8c5f-46ac-9f5a-c6f8d84b6f10}" name="WinXP-IE6" OSType="WindowsXP" lastStateChange="2009-06-25T19:29:04Z">

b) Remove the ‘existing’ hard disk

Example

Remove

<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{e3fb9c99-4c33-4c05-b26d-144c38404efa}"/>
</AttachedDevice>

5) Add the new hard disk as a resource

Command

GUI > File > Virtual Media Manager > Hard Disks > Add

Example

GUI > File > Virtual Media Manager > Hard Disks > Add

WinXP-IE6.vdi

6) Attach new disk to new VM.

GUI > [VM] > Settings > Storage > [Add]

Example:

GUI > [VM] > Settings > Storage > [Add]
IDE Primary Master > WinXP-IE6.vdi

7) Stop and Restart Virtual Box

8) You’re done! Start the new VM.

Microsoft Entourage Email – Remove recent recipients

In Microsoft Entourage, to remove recent recipients from the list of suggested email addresses:

Preferences >  Main and News Preferences > Compose > Clear List

DebugBar – Debugging Internet Explorer (IE)

DebugBar provides a nice, simple Javascript console for IE. Does a little better on telling you where problems are too.

Safari – Enabling the developer tools

See Enable the Debug menu in Safari 3.0 for Windows

Debugging RubyGems dependencies

Rubygems overrides the standard Ruby ‘require’ statement.  If you need to see what RubyGems is actually doing, in the file

.../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb

add code similar to the following:

def require(path) # :doc: (original code)
    if ENV['RUBYGEM_DEBUG'] and ENV['RUBYGEM_DEBUG'] == 'true'
      puts "\ngem rubygems 1.3.4 require called from"
      1.upto(3) do |idx|
        puts caller[idx,1]
      end
      puts "gem rubygems 1.3.4 require about to require \"#{path}\""
    end
gem_original_require path # (original code)

Then create aliases similar to the following to turn ‘require’ debugging on and off.

alias rubygem_debug_on='export RUBYGEM_DEBUG=true'
alias rubygem_debug_off='export RUBYGEM_DEBUG=false'

That’s it!

Installing a second copy of Ruby and Rubygems

If you want to install a second suite of Ruby, Rubygems and gems, and allow the second suite to be used on demand you can follow something similar to the following manual procedure.

Create the base for a new directory structure

sudo mkdir /opt/ruby186

Install the basics, forcing them into the new structure

(this assumes you have the appropriate distributions unpacked in some build directory)

cd readline-5.2
make clean
 ./configure --prefix=/opt/ruby186
make
sudo make install

cd ../ruby-1.8.6-p111
make clean
./configure --prefix=/opt/ruby186 --disable-pthread --with-readline-dir=/opt/ruby186 --enable-shared
make
sudo make install

cd ../rubygems-1.3.4
export PATH=/opt/ruby186/bin:${PATH} # VITAL
sudo ruby setup.rb

Make an alias to set your PATH on demand

alias rubyother='export PATH=/opt/ruby186/bin:${PATH}'

Put the alias into one of your shell startup files – e.g. ~/.bashrc

When you need to switch to this version of Ruby, open up a new terminal window, type ‘rubyother’ and you’re using the second version of Ruby. When you close the window, these settings disappear – which is what you want.

WordPress Themes