Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting to Know VirtualBox and Your Network

DZone's Guide to

Getting to Know VirtualBox and Your Network

Get a glimpse at VirtualBox and its API as well as a variety of network architecture that you can use to get your VMs up and running and talking to each other.

· Cloud Zone
Free Resource

Production-proven Mesosphere DC/OS is now even better with GPU scheduling, pods, troubleshooting, enhanced security, and over 100+ integrated services deployed in one-click.

VirtualBox is a high-performance, cross-platform virtualization engine for use on coImage titlemputers running Windows, Linux distributions, and others. Designed for use on Intel and AMD x86 systems, VM VirtualBox can be deployed on desktop or server hardware. As a hosted hypervisor, it extends the existing operating system installed on the hardware rather than replacing it.

VirtualBox includes a hypervisor for the host platform, an application programming interface (API) and software development kit (SDK) for managing guest virtual machines, a command-line tool for managing guests locally, a web service for remote management of guests, a wizard-style graphical tool to manage guests, a graphical console for displaying guest applications on the local host, and a built-in Remote Desktop Protocol (RDP) server that provides complete access to a guest from a remote client.

VirtualBox Architecture

Image title


VirtualBox API = VBoxMananger = CLI

VBoxMananger is the command line interface to VirtualBox. If you put a command from VBoxMananger into the console, is possible see all commands and how they interact with the VirtualBox API.

Image title


The command to list all VMs is:

$ VBoxManage list vms


Image title








It is possible to create VMs with the command line, but is necessary to have ISO to the system operation that you want installed.

Step 1:

Image title

Step 2:

Image title

VBoxMananger is the tool that Vagrant uses for samples to create environments.

VirtualBox Network

There are three types of networks:

  1. NAT with port forwarding.
  2. Bridged networking.
  3. Internal networking.
  4. Host-only networking.

Image title


NAT Networking

  • NAT = Networking Address Translation.
  • Each VM has your own sub-network with your public IP.
  • Share the same resources of that host.
  • VMs cannot see each other.
  • IP, Gateway, and DNS cannot be changed.


Image title


Bridged Networking

  • VMs and the host are in the same network.
  • VMs have access to the physical network in the same way the host does.
  • Can be found in the physical network.


Image title

Internal Networking

  • Isolated network.
  • Only VMs are within a private network.
  • Host can’t see the private network.


Image title


Host-Only Networking

  • Hybrid between bridge and internal networks.
  • Private Network to the host and VMs.
  • VMs can’t see external networks.
  • Host has private IP to the internal network.

Conclusion

In this post, I focused on one difficult point people I know tend to bring up (VirtualBox API and VirtualBox Network). These solutions are what worked for me. Let me know what you think in the comments below.

Simply build, test, and deploy. Mesosphere DC/OS is the best way to run containers and big data anywhere offering production-proven flexibility and reliability.

Topics:
devops ,virtualization ,network

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}