<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rusty Razor Blade &#187; virtual box</title>
	<atom:link href="http://www.rustyrazorblade.com/category/virtual-box/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>VirtualBox 4 &#8211; NAT Port Forwarding GUI</title>
		<link>http://www.rustyrazorblade.com/2010/12/virtualbox-4-nat-port-forwarding-gui/</link>
		<comments>http://www.rustyrazorblade.com/2010/12/virtualbox-4-nat-port-forwarding-gui/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 20:27:27 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1278</guid>
		<description><![CDATA[<p>Version 4.0 of VirtualBox will have NAT port forwarding available in an easy to use GUI. The more fervent readers of this blog will remember <a href="/2010/11/setting-up-nat-port-forwarding-with-virtualbox/">this post</a> which I described how to set this up on the command line.</p> <p>Open your VirtualBox networking settings, and click the port forwarding button. </p> <p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-12.16.17-PM.png"></a></p> <p>Click [...]]]></description>
			<content:encoded><![CDATA[<p>Version 4.0 of VirtualBox will have NAT port forwarding available in an easy to use GUI.  The more fervent readers of this blog will remember <a href="/2010/11/setting-up-nat-port-forwarding-with-virtualbox/">this post</a> which I described how to set this up on the command line.</p>
<p>Open your VirtualBox networking settings, and click the port forwarding button.  </p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-12.16.17-PM.png"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-12.16.17-PM.png" alt="nat prefs" title="Screen shot 2010-12-20 at 12.16.17 PM" width="520" height="375" class="size-full wp-image-1279" /></a></p>
<p>Click the little plus on the right to add your settings.  You can leave out the IP &#8211; it&#8217;s optional.</p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-12.16.42-PM1.png"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-12.16.42-PM1.png" alt="" title="Screen shot 2010-12-20 at 12.16.42 PM" width="500" height="312" class="size-full wp-image-1283" /></a></p>
<p>You used to have to shut down your VM to change these settings.  With VirtualBox 4, they can be changed while it&#8217;s running.  Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/12/virtualbox-4-nat-port-forwarding-gui/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting up NAT Port Forwarding with VirtualBox</title>
		<link>http://www.rustyrazorblade.com/2010/11/setting-up-nat-port-forwarding-with-virtualbox/</link>
		<comments>http://www.rustyrazorblade.com/2010/11/setting-up-nat-port-forwarding-with-virtualbox/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 20:47:30 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1232</guid>
		<description><![CDATA[<p>I&#8217;ve typically used bridged networking with VirtualBox, but you can run into some issues. If you&#8217;re somewhere without internet access, or if you&#8217;re changing IPs often, you might be better off using NAT settings. There&#8217;s a few other advantages &#8211; for instance you won&#8217;t need to check the IP of your machine in order to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve typically used bridged networking with VirtualBox, but you can run into some issues.  If you&#8217;re somewhere without internet access, or if you&#8217;re changing IPs often, you might be better off using NAT settings.  There&#8217;s a few other advantages &#8211; for instance you won&#8217;t need to check the IP of your machine in order to connect to it over SSH.  It&#8217;ll just work.  Sweetness.</p>
<p>To get started, your VM must be shut down.  As far as I can tell, it cannot be suspended either.  Shut it off.</p>
<p>First, get a list of your VMS.</p>
<p><code>haddad:~ jhaddad$ VBoxManage list vms<br />
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6<br />
(C) 2005-2010 Oracle Corporation<br />
All rights reserved.</p>
<p>"WebServer" {2c61a180-e098-4926-b09a-27e431791c88}<br />
"Ubuntu" {01b85d8f-897a-412c-84b2-de285b34dd28}</code></p>
<p>Next, set up a port over 1024 that you&#8217;ll use to access your VM.  I chose port 2222 to be SSH.  </p>
<p><code>haddad:~ jhaddad$ <strong>VBoxManage modifyvm Ubuntu --natpf1 "ssh,tcp,,2222,,22"</strong><br />
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6<br />
(C) 2005-2010 Oracle Corporation<br />
All rights reserved.</code></p>
<p>Check your settings </p>
<p><code>haddad:~ jhaddad$ <strong>VBoxManage showvminfo Ubuntu | grep NIC</strong><br />
NIC 1:           MAC: 080027AFA78E, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0<br />
NIC 1 Settings:  MTU: 0, Socket( send: 64, receive: 64), TCP Window( send:64, receive: 64)<br />
NIC 1 Rule(0):   name = ssh, protocol = tcp, host ip = , host port = 2222, guest ip = , guest port = 22</code></p>
<p>The important thing here is the NIC 1 Rule &#8211; it&#8217;ll list your host port (2222) and your guest port that it maps to (22).</p>
<p>To connect, use the host port you defined, in this case 2222.</p>
<p><code>haddad:~ jhaddad$ ssh localhost -p 2222</code></p>
<p>If you&#8217;ve set up a web server, say on 8888, make sure you put that in your URL.  It&#8217;ll map back to port 80 and you&#8217;ll be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/11/setting-up-nat-port-forwarding-with-virtualbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Headless Virtual Box</title>
		<link>http://www.rustyrazorblade.com/2010/07/headless-virtual-box/</link>
		<comments>http://www.rustyrazorblade.com/2010/07/headless-virtual-box/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 23:07:01 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1116</guid>
		<description><![CDATA[<p>I like running VirtualBox headless on my Mac. It doesn&#8217;t show up in the Dock, and feels like it&#8217;s a remote server.</p> <p>First, figure out which VMs you have on your machine.</p> haddad-work:~ jhaddad$ VBoxManage list vms Oracle VM VirtualBox Command Line Management Interface Version 3.2.6 (C) 2005-2010 Oracle Corporation All rights reserved. "WebServer" {2c61a180-e098-4926-b09a-27e431791c88} [...]]]></description>
			<content:encoded><![CDATA[<p>I like running VirtualBox headless on my Mac.  It doesn&#8217;t show up in the Dock, and feels like it&#8217;s a remote server.</p>
<p>First, figure out which VMs you have on your machine.</p>
<pre>haddad-work:~ jhaddad$ VBoxManage list vms
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.

"WebServer" {2c61a180-e098-4926-b09a-27e431791c88}</pre>
<p>Then start it using VBoxHeadless</p>
<pre>nohup VBoxHeadless -s WebServer -vrdp on  &#038;</pre>
<p>I&#8217;m using <a href="http://cord.sourceforge.net/">Cord</a> for RDP.</p>
<p>Open up Cord.  If you&#8217;re using the default settings, you can just go to quick connect and type &#8220;localhost&#8221;.  You&#8217;ll see your VM booting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/07/headless-virtual-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox Guest Additions &#8211; Redhat / CentOS</title>
		<link>http://www.rustyrazorblade.com/2010/04/virtualbox-guest-additions-redhat-centos/</link>
		<comments>http://www.rustyrazorblade.com/2010/04/virtualbox-guest-additions-redhat-centos/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:49:24 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1089</guid>
		<description><![CDATA[<p>Mount VirtualBox Additions disk through the VirtualBox UI.</p> yum install -y gcc kernel-devel-`uname -r` mkdir /mnt/cdrom mount -o ro -t iso9660 /dev/cdrom /mnt/cdrom sh /mnt/cdrom/VBoxLinuxAdditions-amd64.run <p>Info found on <a href="http://tuxtraining.com/2009/01/06/install-guest-additions-in-centos-through-virtualbox">tuxtraining.com</a></p>]]></description>
			<content:encoded><![CDATA[<p>Mount VirtualBox Additions disk through the VirtualBox UI.</p>
<pre>
yum install -y gcc kernel-devel-`uname -r`
mkdir /mnt/cdrom
mount -o ro -t iso9660 /dev/cdrom /mnt/cdrom
sh /mnt/cdrom/VBoxLinuxAdditions-amd64.run
</pre>
<p>Info found on <a href="http://tuxtraining.com/2009/01/06/install-guest-additions-in-centos-through-virtualbox">tuxtraining.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/04/virtualbox-guest-additions-redhat-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Kickstart to Automate CentOS VM Creation</title>
		<link>http://www.rustyrazorblade.com/2009/10/using-kickstart-to-automate-centos-vm-creation/</link>
		<comments>http://www.rustyrazorblade.com/2009/10/using-kickstart-to-automate-centos-vm-creation/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:54:43 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=884</guid>
		<description><![CDATA[<p>I&#8217;ve done this using CentOS, but I&#8217;m pretty sure the same thing will work with RedHat the exact same way.</p> <p>Virtualization is now a commodity with several free tools available from Sun, VMWare and Xen. If you&#8217;re like me, you like to create a new, clean VM for each experiment. However, this comes with a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done this using CentOS, but I&#8217;m pretty sure the same thing will work with RedHat the exact same way.</p>
<p>Virtualization is now a commodity with several free tools available from Sun, VMWare and Xen.  If you&#8217;re like me, you like to create a new, clean VM for each experiment.  However, this comes with a drawback &#8211; the installation process, choosing your timezone, putting in the same password every time, etc&#8230; takes a while.  </p>
<p><img src="http://www.rustyrazorblade.com/wp-content/uploads/2009/10/Screen-shot-2009-10-24-at-1.03.24-PM.png" alt="Screen shot 2009-10-24 at 1.03.24 PM.png" border="0" hspace=10 vspace = 10 width="346" height="224" align="right" /></p>
<p>Fortunately, CentOS provides the means to automate the process via a kickstart file.  The best part is, after you do an install, you&#8217;ll have a kickstart file to start working with &#8211; it&#8217;ll save all your options in /root/anaconda-ks.cfg.  You can edit this file later to include other packages that you&#8217;d like to install, such as the GCC c++ libraries.  You can also run other commands through yum, and customize the system-wide bashrc. </p>
<p>I&#8217;m only going to go over how I did the install &#8211; for the full details check out the <a href="http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html">CentOS kickstart guide</a></p>
<p>I&#8217;ve created a minimal kickstart file to do a base install without gnome, printing, and any tools I don&#8217;t find useful.  I&#8217;ve disabled X completely &#8211; I have no need to boot to a GUI.  I&#8217;ve also uncommented the lines to configure the drive settings, so I won&#8217;t be prompted for anything along the way; my VM should be completely ready to go once I reboot after the installation.  Pretty awesome.</p>
<p>There&#8217;s a convenient way to run a kickstart file off a http connection, so I&#8217;ve put it the web server on my dev box.  My dev box&#8217;s IP address is 192.168.1.5, and I copied the modified /root/anaconda-ds.cnf (which I&#8217;ve renamed to ks.cfg) to the server. At the installation boot prompt, I&#8217;d enter:</p>
<blockquote><p>
linux ks=http://192.168.1.5/ks.cfg
</p></blockquote>
<p>Then let it run.  After a bit it&#8217;ll ready to reboot and be used.  Just make sure to unmount the install DVD.</p>
<p>Obviously this has a lot more uses than just creating VMs, but I&#8217;m not a sysadmin, so I haven&#8217;t personally used it outside the desktop environment.  There&#8217;s other tools for different distros, and third party tools for CentOS/RedHat.</p>
<p>For what I&#8217;ve done so far, one could argue it&#8217;s easier just to create an image of the VM and to just clone that whenever I want a new one.  That&#8217;s a good solution if I was interested in always creating the same exact VM.  However, using the kickstart method has several advantages.  I could create a simple web app that generates new configs based on what I&#8217;ve checked off in a few lists, allowing me to quickly fire up new VMs with the right software for whatever I&#8217;m working on.  I can also upgrade the version of the OS and run the same kickstart, so I don&#8217;t have to maintain some up to date starting image.</p>
<p>If I&#8217;ve made any mistakes, please don&#8217;t hesitate to point them out.  I&#8217;m by no means a guru on the subject, I&#8217;ve just wanted to look into this topic for a while. </p>
<p>Some Other Useful resources</p>
<ul>
<li><a href="http://www.linux-mag.com/id/6747/">Linux-Mag</a></li>
<li><a href="http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/ch-kickstart2.html">Red Hat Kickstart Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/10/using-kickstart-to-automate-centos-vm-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox &#8211; SSH&#8217;ing into a VM from an outside machine</title>
		<link>http://www.rustyrazorblade.com/2009/10/virtualbox-sshing-into-a-vm-from-the-outside/</link>
		<comments>http://www.rustyrazorblade.com/2009/10/virtualbox-sshing-into-a-vm-from-the-outside/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 20:43:50 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=877</guid>
		<description><![CDATA[<p>Note: The terminology used below also applies to VMWare. The screens are different, but the issue and the solution are the same.</p> <p>When creating a new VM through VirtualBox, you might have a problem SSH&#8217;ing into the box. You also might notice you get a 10.0.x.xx type address, even though the rest of your network [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: The terminology used below also applies to VMWare.  The screens are different, but the issue and the solution are the same.</em></p>
<p>When creating a new VM through VirtualBox, you might have a problem SSH&#8217;ing into the box.  You also might notice you get a 10.0.x.xx type address, even though the rest of your network is a 192.168.xx.xxx deal.  Yes, the two are related.</p>
<p>Essentially what&#8217;s happening is the VM is sitting on it&#8217;s on little private line, where it can go out but nothing can reach it.  By default, the network setting is &#8220;NAT&#8221;.  If we want the VM to be accessible to the outside, we want to use Bridged networking.</p>
<p>This is easily solved, but requires that the VM be shut down.  Go to the network second, pick an unused adapter (likely the 2nd one), enable it, and choose Bridged.  </p>
<p>You should see this under the VM description now.</p>
<p><img src="http://www.rustyrazorblade.com/wp-content/uploads/2009/10/Screen-shot-2009-10-24-at-1.33.59-PM.png" alt="Screen shot 2009-10-24 at 1.33.59 PM.png" border="0" width="519" height="85" /></p>
<p>Go ahead and boot back into your VM.  Fire up a terminal, run /sbin/ifconfig, and you&#8217;ll see you now have an ethernet adapter with an address you can reach.  </p>
<p><img src="http://www.rustyrazorblade.com/wp-content/uploads/2009/10/Screen-shot-2009-10-24-at-1.37.58-PM.png" alt="Screen shot 2009-10-24 at 1.37.58 PM.png" border="0" width="523" height="463" /></p>
<p>Enjoy!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/10/virtualbox-sshing-into-a-vm-from-the-outside/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

