Shutting down all VirtualBox (vagrant) VMs in one easy to use bash command (that can be put into a bash file)

1

First, look for the Git Bash prompt provided by msysGit. It's probably on your desktop, but if you can't find it there, have a look in the Start Menu.

This is a version of Bash, which is a standard shell on GNU/Linux systems (for shell basics, start here). Fire it up and enter the following commands:

mkdir vagrant_demo cd vagrant_demo vagrant init hashicorp/precise32mkdir vagrant_demo cd vagrant_demo vagrant init hashicorp/precise32

You should now have a folder containing a basic Vagrantfile. (There's a lot of documentation on Vagrantfiles.)

Next, do vagrant up, which should download an image, set it up, and start a virtual machine running in VirtualBox. This will probably take a while.

There you have it: A working Linux VM. What now? Well, you can:

Continue with the Getting Started section of the official Vagrant manual. Check out our ongoing series of introductory Linux...
0 0
2

If you're using VirtualBox as a virtual machine (VM) server in your data center, chances are you're going to want to know how to run those VMs without having to rely on the VirtualBox GUI. This makes it much easier to run your VMs without having to be at the host machine (you can ssh into the host and then manage the VMs) or without having a number of GUI windows open to clutter your server desktops (or be readily available for prying eyes).

To make this happen, you'll use a very powerful command that comes with VirtualBox called VBoxManage; it allows you to manage a number of aspects of your VMs. I'll show how to use VBoxManage to start, stop, and pause your VMs. I assume you have VirtualBox installed, and your VMs are ready to run on the host machine.

SEE: Building the Software Defined Data Center (ZDNet/TechRepublic special feature)

Before you fire up a VM

If you go directly to the VBoxManage command and fire up a VM, you'll probably find that VM...

0 0
3

Introduction and Motivation

This article is written for Windows users that would like to extend their skill-set to Linux and assumes you are comfortable with the command line. Go brush up before reading this if you are unsure what a command line is:)

I wish I would have spent more time as a kid learning Linux than all the time I wasted on Windows. That is my biggest regret when it comes to technology. Once I started to see all the amazing software available on Linux (for free), I realized the potential . The road to practical application wasn't easy, but it was fun. Now, with a few years under my belt, I am able to save time utilizing the tools that already exist, or having the capability to create my own without having to buy licenses for them!

This post is designed for the intermediate Windows users that are ready to start using Linux for whatever reason you have. I think the easiest way (but not the most useful) to use Linux is to install Mint, install on a...

0 0
4

If you just started using Vagrant (which I highly recommend), and on the last version of OSX (or any other system as a matter of fact) + VirtualBox, it’s highly likely that you’ll stumble on an error during your first `vagrant up` :

mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant Stdout from the command: Stderr from the command: mount: unknown filesystem type 'vboxsf'

The sharing isn’t setup. A bit frustrating. And you’ll need to install Guest Additions on the box (and that’s not straightforward if using Vagrant).

Turns out, the fix is quite easy.

First, download : http://download.virtualbox.org/virtualbox/4.2.16/VBoxGuestAdditions_4.2.16.iso (replace 4.2.16 by your VirtualBox version).

Now fire up VirtualBox, select your virtual machine, Command+F to power it off, then Command+S for settings, select Storage then click on Add CD/DVD Device, then select the freshly downloaded ISO.

Go back to your app directory...

0 0
5

This page lists some common issues people run into with Vagrant and VirtualBox as well as solutions for those issues.

» Hanging on Windows

If Vagrant commands are hanging on Windows because they're communicating to VirtualBox, this may be caused by a permissions issue with VirtualBox. This is easy to fix. Starting VirtualBox as a normal user or as an administrator will prevent you from using it in the opposite way. Please keep in mind that when Vagrant interacts with VirtualBox, it will interact with it with the same access level as the console running Vagrant.

To fix this issue, completely shut down all VirtualBox machines and GUIs. Wait a few seconds. Then, launch VirtualBox only with the access level you wish to use.

» DNS Not Working

If DNS is not working within your VM, then you may need to enable a DNS proxy (built-in to VirtualBox). Please see the StackOverflow answers here for a guide on how to do...

0 0
6

These instructions allow you to set up an Ubuntu cluster ready to network Docker containers with Calico using Vagrant.

1. Streamlined setup of the VMs

1.1 Install dependencies

1.2 Download the source files

mkdir demo; cd demo curl -O https://docs.projectcalico.org/v2.3/getting-started/docker/installation/vagrant-ubuntu/Vagrantfile

1.3 Startup and SSH

For Calico as a Docker network plugin

To connect to your servers

Linux/Mac OS X run vagrant ssh Windows

1.4 Verify environment

You should now have two Ubuntu servers, with Etcd running on the first server.

At this point, it’s worth checking that your servers can ping each other.

From calico-1

From calico-2

If you see ping failures, the likely culprit is a problem with the VirtualBox network between the VMs. You should check that each host is connected to the same virtual network adapter in VirtualBox and rebooting the host may also help....

0 0
7

I’ve gotten to the point in my web development career where I can no longer avoid the words VirtualBox, Vagrant, and Docker. Thanks to my friend Timm Stelzer, I finally got over my fear of the unknown and delved into the world of virtual machines via Vagrant and VirtualBox.

Now that I’ve finally used them, I can see how fun and useful they are, and since I’ve just set everything up myself in 2017 with the most up-to-date installations I could find, I can share what I’ve learned with you.

Prerequisites

The only prerequisite to this article is command line knowledge, and it is mandatory. This article that I wrote, How to Use the Command Line, will tell you everything you need to know, from moving around directories, creating files, and sshing into servers. If you’re not familiar with any of that, please read the aforementioned article.

Goals

In this tutorial, we will learn:

What VirtualBox is What Vagrant is How to use Vagrant and VirtualBox...
0 0