Building a VirtualBox server lab on OsX with NAT and Internal Networking (intnet) 29

Posted by Peter Burkholder Wed, 27 May 2009 00:13:00 GMT

Chef and Puppet, Take 2

A few weeks ago I announced my intent to compare Puppet to Chef, then quickly got bogged down with, among other things, needing to get my Typo installation up to snuff.

I’m going to take another shot at this, with the initial goal of getting Puppet and Chef running on CentOS 4.7 inside VirtualBox on a OsX 10.4 system.

VirtualBox

VirtualBox is a semi-free virtual environment from Sun. The open-source version seems suitable for server testing, but there’s also a more fully-featured proprietary version. I’m choosing it because I have more space on my $WORK system then my personal system, but I don’t have a VmWare Fusion license. Further, my home virtual Linux systems are all Ubuntu, and $WORK is RHEL, so there’s more point to this exercise using a RHEL-derived system if I’m going to get some traction on my plan to get a configuration-management system rolling at my workplace.

Creating a new VirtualBox

First I’m going to get two instances of Damn Small Linux. In VirtualBox

  • click “New”
  • select “Linux”, “Debian”, “256 Mb Ram”, “34 Mb hard drive”
  • create
  • in the system description, select CD/DVD-ROM and connect to the .iso image
    • in VirtualBox, you ‘Add’ isos from various places in your filesystem to a list of available ISOs, so add dsl-4.4.10-initrd.iso
  • Press ‘Start’ then you get an info window on which key to use to de-associate your keyboard from the GuestOS.
  • DSL (DamnSmallLinux) boots astonishingly fast
  • The process of cloning a system is not worth it for a diskless system. Just make DamnSmall2 following the same steps.

Out of the box, this created two hosts connected to the world via NAT, but both apparently on the same IP address (10.0.2.15). So far, so good.

What I want is:

  • All VMs to have NAT access to the world, and SSH access from the host operating system via port-forwarding.
  • All VMs to communicate with each other over an internal-only network at 192.168.5.0

It seems that the VirtualBox tutorials out there really muddy up the water. It’s not that hard.

NAT and port-forward ssh access

  • VirtualBox configuration
    • Add network adapter 1 as NAT
    • Run the following script

# Number all hosts up from 1
host=DamnSmall1
port=2201

# let eth0/adapter1 be DHCP NAT
VBoxManage setextradata "$host" \
    "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP 
VBoxManage setextradata "$host" \
    "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22 
VBoxManage setextradata "$host" \
    "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" $port
  • Guest Host Configuration—turns out the IP doesn’t matter ‘cause we use port-forwarding to reach the host
    • Debian /etc/network/interfaces
iface eth0 inet dhcp

Internal Networking on Static IPs

  • VirtualBox Configuration
    • Connect Adapter 2 to ‘intnet’ internal network
  • Guest Host configuration: Set up eth1 static ip addresses internally, e.g.
    • Debian /etc/network/interfaces
iface eth0 inet static
    address 192.168.5.201
    netmask 255.255.255.0
Comments

Leave a comment

  1. fast cash loans about 1 year later:
    I was seeking for money fast to pay off urgent bills. I applied for fast cash loans online and after few minutes of processing, I got the notification that I have been approved for the loan. The next day, they deposited the money in my bank account and I was able to make the payments promptly. Thanks a lot and I really find your service helpful!
  2. seo company about 1 year later:
    Nice article.SEO Is a very important part of advertising and marketing, and will bring you the results you so desire.
  3. Application Integration Services about 1 year later:
    Really appreciate this post. It’s hard to sort the good from the bad sometimes, but I think you’ve nailed it!
  4. Good post....thanks for sharing.. very useful for me i will bookmark this for my future needs. Thanks.
  5. uninterruptible power supplies about 1 year later:
    uninterruptible power supplies Guide by Riello UPS Ltd. The guide features hints and tips on choosing the best uninterruptible power supplies for your requirements.
  6. bridesmaid dresses about 1 year later:
    This was actually what I was looking for, and I am glad that I finally came here! This for sharing and keep up the good work... thanks for this nice article Good post.....Valuable information for all. I will recommend my friends to read this for sure
  7. Home Builder Materials about 1 year later:
    Buildshoppe.com is India’s 1st portal on building solutions. For building supplies, sustainable & efficient building materials, building construction services, home builder materials, housing materials, visit buildshoppe.com.
  8. Alarm Company about 1 year later:
    Another great post, I appreciate all the work you put into this site, helping out others with your fun and creative works.
  9. LPN job description about 1 year later:
    Excellent post.Thanks for sharing such a useful informative post with us...
  10. Property management about 1 year later:
    Excellent piece of code. Thanks for the help.
  11. high protein foods about 1 year later:
    A few of the most effective high protein foods have high fat counts; nonetheless, it’s important to consider that not all fats are poor for you, and some could be incredibly advantageous for your diet- even though fat loss is your major priority.
  12. casino en ligne about 1 year later:
    I want to express my admiration of your writing skill and ability to make reader to read the while thing to the end.
  13. Hotel Management Institute about 1 year later:
    Excellent read, I just passed this onto a colleague who was doing a little research on this topic.
  14. south florida mortgage brokers about 1 year later:
    I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it. It’s really a great post.
  15. Gucci Sale Outlet about 1 year later:
    I love the expression. Everyone needs to express there own opinion and feel free to hear others. Keep it up
  16. Sale Gucci Shoes Outlet about 1 year later:
    Good post....thanks for sharing.. very useful for me, I will bookmark this for my future needs.
  17. Air Max pas cher about 1 year later:
    Many thanks to the person who made this post, this was very informative for me. Please continue this awesome work. Sincerely... The article is very well!
  18. Gucci Handbags about 1 year later:
    I’ve been looking everywhere for this! Thank goodness I found it on Bing.Thx
  19. ED Hardy Clothing about 1 year later:
    It is so lucky to read your blog,it is full of useful message.I wish we both can do better in the future.It great honour if you can visit our website,and give us some suggession.
  20. Property about 1 year later:
    This blog Is very informative , I am really pleased to post my comment on this blog . It helped me with ocean of knowledge so I really belive you will do much better in the future.
  21. jewelry making about 1 year later:
    After reading this, I found myself in a right track! Thank you for assuring me.
  22. used car loans michigan about 1 year later:
    The excellent tutorial and it is definitely going to help me some time. Really good ideas
  23. ED Hardy underwear about 1 year later:
    Good writing, beautiful pictures, wow, it is wonderful,wonderful, we will always support you
  24. eyeglasses online over 2 years later:
    Very nice and impressive article you have posted.
  25. Diablo3 over 2 years later:
    Hmm,i see that you made your points,you are really a cool author.
  26. The Diet Solution Program over 2 years later:
    When I at first left a comment I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get three notification emails with the same comment. Is there any way you can take away people from that service? Thanks a lot!
  27. titleist 910d2 over 2 years later:
    http://www.togolfmart.com/index.php?main_page=product_info&cPath=65_30&products_id=256 http://www.golfmartdiscount.com/titleist-910d3-driver-p-234.html The development of the next things a bit like a story, a few days later my father received a phone call actually really rather he went to the country to interview the company Iron, especially with his mother's hand every time to do a variety of nutritious foods over the span of hundreds of miles to see her, she will have a lingering sense of guilt Father did not take long after drug use, mother marrying his home, never to return Those big trucks and pull freight cars nobody dared to reply to my people" Iron said: "I really hungry, we prepared a newspaper I have no time to eat lunch If not do that thing, then maybe we help each other to learn each other's love relationship will last longer more
  28. Theresa M. Nichols over 2 years later:
    The one thing exciting about a destination wedding is, you can experiment a lot with your destination wedding dresses. Getting married on a beach is like a dream come true and your destination beach wedding dresses should be in sync with the soothing ambiance endowed upon by the sun, sand and the sea.
  29. Evening Dresses uk over 2 years later:
Comments