Quick Guide to Setting Up an Ubuntu Virtual Machine with Vagrant
This tutorial explains how to enable virtualization, install VirtualBox and Vagrant, add an Ubuntu box from a Chinese mirror, configure the Vagrantfile, launch the VM, and connect via SSH, providing all necessary commands and screenshots for a fast Ubuntu development environment.
Before starting, ensure that Intel Virtualization Technology is enabled in the BIOS/UEFI settings.
Download and install VirtualBox , a popular virtual machine manager.
Download and install Vagrant , which simplifies creation and management of virtual machines.
Verify the installation by running the vagrant command in a terminal.
Add an Ubuntu box from a domestic mirror (Tsinghua University) using one of the following commands, depending on the desired Ubuntu version:
# 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 ubuntu14Initialize a Vagrant configuration file:
vagrant initEdit the generated Vagrantfile (located at C:\Users\Administrator\Vagrantfile ) and replace the default box line:
config.vm.box = "base" # change to
config.vm.box = "ubuntu18"Start the virtual machine:
vagrant upOnce the VM is up, connect to it via SSH:
vagrant sshThe article also includes several screenshots illustrating each step of the process.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.