Saturday, June 19, 2010

VirtualBox - NAT - Ruby on Rails - SSH - SSHFS

How-to setup NAT, SSH, SSHFS, Ruby On Rails and VirtualBox.

Assumes pcnet nic.

Version

% VBoxManage -v
3.0.14r58977


SSH. Half the fun [1] of unix-y operating systems is shell.

% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP


SSHFS. Mount the guest $HOME directory and edit files using TextMate.

/Applications/sshfs/bin/mount_sshfs -p 2222 brian@localhost ~/sshfs/hilda


Rails.

% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Rails/HostPort" 3001
% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Rails/GuestPort" 3000
% VBoxManage setextradata hilda "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Rails/Protocol" TCP

Restart or start the guest.
Launch Rails on the guest.
Hit up http://localhost:3001/

[1] I have odd notions for the value of 'fun'.
blog comments powered by Disqus