Operations 3 min read

Quick Setup of an Ubuntu Virtual Machine Environment Using Vagrant

This guide walks through enabling virtualization, installing VirtualBox and Vagrant, adding Ubuntu box images from Chinese mirrors, configuring the Vagrantfile, and using Vagrant commands to start, SSH into, and manage an Ubuntu virtual machine on Windows.

Wukong Talks Architecture
Wukong Talks Architecture
Wukong Talks Architecture
Quick Setup of an Ubuntu Virtual Machine Environment Using Vagrant

1. Enable virtualization in BIOS (Intel Virtualization Technology → Enabled).

2. Download and install VirtualBox, a virtual machine manager, from the official website.

3. Download and install Vagrant, a tool for creating and managing VMs, from its official site and optionally use the official box repository.

4. Add Ubuntu box images from Tsinghua mirrors using Vagrant commands:

# ubuntu 18.04 LTS:
vagrant box add https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-amd64-vagrant.box --name ubuntu18

# ubuntu 16.04 LTS:
vagrant box add https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-amd64-vagrant.box --name ubuntu16

# ubuntu 14.04:
vagrant box add https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box --name ubuntu14

5. Initialize a Vagrant project and edit the generated Vagrantfile to replace config.vm.box = "base" with the desired Ubuntu box name, e.g., ubuntu18 .

6. Start the VM with vagrant up , then connect via SSH using vagrant ssh .

The article also shows how to verify Vagrant installation by running vagrant in the command line.

DevOpsVMwindowsUbuntuVirtualBoxVagrant
Wukong Talks Architecture
Written by

Wukong Talks Architecture

Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.