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.
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 ubuntu145. 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
