Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

How to Use Vagrant on an Ubuntu VPS

A practical Ubuntu VPS guide to Vagrant, covering nested-virtualization checks, KVM/libvirt and VirtualBox setup, provider-specific boxes, networking, lifecycle commands and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: You can run Vagrant inside an Ubuntu VPS only when that VPS exposes the CPU virtualization features needed by a provider. For an Ubuntu server, KVM with libvirt is usually the natural provider; VirtualBox is a separate option that requires its own installation and kernel support. Check virtualization first, install one provider, use a box published for that provider, then run the normal vagrant init → vagrant up → vagrant ssh lifecycle.

Expect NAT networking by default with libvirt, and treat Canonical’s public Ubuntu boxes as disposable local-development images rather than production deployments. The provider, box format, VPS networking and host firewall determine whether the guest can start and whether anyone can reach it.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What running Vagrant on a VPS actually means

Vagrant is a command-line layer for defining and managing virtual machines. On a desktop, it commonly drives VirtualBox. On an Ubuntu server, it can drive KVM through libvirt, or another provider installed through a plugin. Vagrant does not supply the virtualization engine itself: the selected provider creates the guest, allocates CPU and memory, attaches disks and supplies networking.

On a VPS, this creates a nested-virtualization arrangement. Your Ubuntu instance is already a guest of a hosting platform, and Vagrant attempts to create another guest inside it. Installing the Ubuntu packages can succeed even when the outer VPS blocks the CPU extensions or device access required by KVM or VirtualBox. A successful package installation is therefore not proof that a VM can start.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

The first gate is host capability

Ubuntu’s server documentation recommends checking hardware virtualization extensions with kvm-ok before configuring libvirt. On a VPS, interpret that result as an availability check for the hosting plan: if it fails, ask the VPS provider whether KVM or nested virtualization is exposed. Vagrant syntax cannot manufacture a missing capability.

kvm-ok

A passing check still does not guarantee that your plan permits every nested operation. Provider policies, quotas, kernel modules, firewall rules and available disk or memory can prevent a guest from launching. A failing check is more decisive: resolve the VPS capability issue or move the workload to a host that advertises nested virtualization before spending time on Vagrant configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the provider before installing anything

Provider choice affects installation, box compatibility and networking. Decide whether the VPS is intended for disposable development or for a service that must remain reachable and supported. The following comparison uses the practical axes that matter on an Ubuntu server.

Provider What the VPS must expose Installation on Ubuntu Box requirement Networking starting point Best fit
libvirt/KVM KVM virtualization extensions and permission to use them Install QEMU/KVM and the system libvirt daemon, add the managing user to the libvirt group, then install the Vagrant libvirt plugin A box published for libvirt; a VirtualBox box is not interchangeable libvirt NAT network by default; bridge when the guest needs direct outside reachability Ubuntu-server workflows and provider-aligned testing
VirtualBox Ability to load VirtualBox and its kernel modules inside the VPS Install VirtualBox separately; Vagrant’s provider support does not install it for you A VirtualBox box Depends on VirtualBox networking and the VPS’s permitted interfaces Existing VirtualBox-based projects when the host genuinely supports it
Other providers The capability and permissions required by that provider Usually a provider-specific Vagrant plugin and host software A box and capabilities explicitly published for that provider Provider-specific Specialized environments where the provider is already available

For most Ubuntu VPS users, libvirt/KVM is the first path to investigate because it matches Ubuntu’s server tooling. VirtualBox can work only when the hosting environment permits it; its presence in an apt command does not make it suitable for every VPS.

Prepare and install Vagrant with libvirt/KVM

Use this route when kvm-ok succeeds and your hosting terms allow nested virtualization. Perform the steps as the user who will run Vagrant, using sudo only for system changes.

1. Install the KVM and libvirt host components

sudo apt-get update
sudo apt-get install qemu-kvm libvirt-daemon-system

The packages provide the QEMU/KVM engine and the system libvirt service. If your Ubuntu release presents additional confirmation or service-start prompts, accept them only after checking the package names offered by that release.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Grant your account libvirt access

sudo usermod -aG libvirt $USER

Group membership normally takes effect after logging out and back in. Start a new shell with the updated group, or reconnect to the VPS, before testing Vagrant. Running the command as a user who has not received the group membership can produce permission errors that look like a broken provider.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

3. Install Vagrant and the libvirt plugin

sudo apt-get install vagrant
vagrant plugin install vagrant-libvirt

The plugin connects Vagrant to libvirt. Verify that the plugin installation completes under the same user that will run vagrant up; installing a plugin for one account does not automatically make it available to another account.

4. Select libvirt explicitly

When more than one provider is installed, remove ambiguity by specifying the provider on the first launch:

vagrant up --provider=libvirt

If Vagrant reports that the provider is not found, check both halves of the setup: the libvirt/QEMU host packages and the vagrant-libvirt plugin. Selecting --provider=libvirt also makes scripts and troubleshooting output easier to interpret.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the VirtualBox path only when the VPS supports it

Vagrant includes built-in provider support for VirtualBox, but VirtualBox itself must be installed separately. HashiCorp’s documentation states that Vagrant displays an error asking for VirtualBox when it is absent. The VPS must also be able to load VirtualBox’s kernel modules and perform the required nested operations; many hosted plans do not permit that.

sudo apt-get update
sudo apt-get install vagrant virtualbox

That is the documented Ubuntu example for a VirtualBox-based setup. Use the package versions available for your Ubuntu release and confirm that the VPS kernel can build or load the modules. HashiCorp’s published compatibility list has included VirtualBox versions from the 4.0.x series through the 7.2.x series; it is a compatibility range, not a performance guarantee, and it can change as new releases arrive.

After installation, initialize a project and launch it without the libvirt flag:

vagrant init ubuntu/jammy64
vagrant up
vagrant ssh

If both providers are installed, use vagrant up --provider=virtualbox when you need to force the choice. Do not assume that a project that works with VirtualBox will work with libvirt simply because both are supported by Vagrant.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Use a box built for the provider you selected

A Vagrant box is a provider-specific archive. It contains the base image and metadata expected by a particular virtualization backend. HashiCorp explicitly notes that a VirtualBox box is incompatible with VMware Fusion or another provider; the same principle applies to libvirt.

  • For VirtualBox, select a box published for VirtualBox.
  • For libvirt, select a box published for libvirt and compatible with your CPU architecture and operating system.
  • For another provider, verify both the provider name and any provider-specific capabilities before adding the box to a project.

The commonly documented Ubuntu example uses ubuntu/jammy64 with the VirtualBox flow. If you switch the project to libvirt, replace it with a libvirt-compatible Ubuntu box rather than trying to force the VirtualBox archive through a different provider. A provider mismatch usually appears during vagrant up as an unavailable box, unsupported provider or missing capability.

Box names and provider builds change over time. Check the publisher’s current metadata for the exact provider label before you initialize a long-lived project, and record that choice in the project documentation so another administrator does not accidentally launch it with a different backend.

Initialize, launch and manage the guest

Create a dedicated directory for each Vagrant environment. The directory becomes the project’s control point: it holds the Vagrantfile and is also the default host side of the synced folder.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Initialize a project

mkdir ubuntu-vagrant
cd ubuntu-vagrant
vagrant init ubuntu/jammy64

vagrant init creates a Vagrantfile that names the base box. Inspect that file before launching, especially if you will use libvirt or a non-default network.

2. Launch the VM

For a VirtualBox project:

vagrant up

For a libvirt project:

vagrant up --provider=libvirt

During vagrant up, Vagrant downloads the box if it is not already present, asks the selected provider to create the VM, applies the Vagrantfile and starts the guest. The first run can therefore take longer and consume significant disk and network bandwidth.

3. Connect over Vagrant’s SSH configuration

vagrant ssh

This command uses the connection details Vagrant generated for the guest. It is preferable to guessing a forwarded port or private address, particularly when the provider has chosen a dynamic host port.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

4. Stop or remove the environment

Use vagrant halt when you want to stop the guest and preserve its disks. Use vagrant destroy when the environment is disposable and you want Vagrant to remove the VM and its provider resources. Destroying a guest does not make the VPS’s virtualization capability reappear, and it can remove data stored only inside the guest.

vagrant halt
vagrant destroy

Keep source code and other irreplaceable data outside the disposable guest, or back it up before destruction. The default synced directory maps the project directory on the host to /vagrant in the guest, so files placed there are available from both sides.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Configure networking deliberately

libvirt’s default is NAT

Ubuntu documents NAT as the default libvirt network. NAT lets the guest initiate outbound connections through the host, which is convenient for package installation and development. It does not, by itself, make a service listening in the guest directly reachable from arbitrary external hosts.

Test reachability from the correct location. A service can be healthy inside the guest while remaining inaccessible from the Internet because it listens only on loopback, the guest is behind NAT, the VPS firewall blocks the port, or the hosting provider filters the traffic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a bridge for direct external reachability

If the guest must appear directly on the surrounding network, configure a bridged network rather than relying on the NAT default. Bridging on a VPS is more constrained than bridging on a physical server: the host may not permit additional MAC addresses, the provider may require a specific virtual interface, and the VPS firewall or upstream network policy may still block traffic.

Plan all of the following before switching to a bridge:

  • The VPS provider’s rules for additional interfaces, MAC addresses and routed or public addresses.
  • The guest’s address assignment and route.
  • The service’s listening address, not just its process status.
  • Ubuntu’s host firewall and any firewall inside the guest.
  • Cloud or provider-side firewall rules that sit outside Ubuntu.

When you only need a development service from the VPS itself, NAT may be sufficient. When another machine must connect directly to the guest, bridging or an explicitly designed forwarding arrangement is required; do not infer external reachability from a successful vagrant up.

Understand what the Ubuntu box is—and is not

Canonical describes its Ubuntu Vagrant boxes as local-development artifacts, not production deployments. They are useful for reproducing an Ubuntu environment, testing provisioning and validating automation, but they should not be treated as a hardened production image simply because the guest boots successfully.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a production service, use an image and operating procedure intended for production, then apply your own patching, identity, secret-management, logging, backup and network controls. Keep the Vagrant guest for repeatable development or short-lived testing unless you have independently built and maintained the security and operational controls that production requires.

Troubleshoot failures in the order they occur

kvm-ok fails

Ask the VPS provider whether KVM or nested virtualization is exposed to your plan. If the answer is no, changing the Vagrantfile, installing another box or repeating vagrant up will not solve the underlying problem. Move to a plan with the required capability or use a non-nested workflow.

Vagrant says the provider is not found

Confirm that the provider software is installed and that the provider plugin is installed for the same user running Vagrant. For libvirt, verify the QEMU/libvirt packages, the libvirt group membership and the vagrant-libvirt plugin. Select the backend explicitly with vagrant up --provider=libvirt or the corresponding provider option.

The box does not support the selected provider

Read the box metadata and choose a build for the provider you are actually using. A VirtualBox box is not converted into a libvirt box by adding --provider=libvirt; the archive itself must contain the provider-compatible image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The guest starts but the service is unreachable

Separate the problem into layers. First check that the process is listening on the expected guest address and port. Then identify whether libvirt supplied NAT or a bridge. Finally inspect the guest firewall, the Ubuntu host firewall and the VPS provider’s firewall or network controls. A running VM proves only that the provider created it; it says nothing about inbound routing.

SSH warns about a changed host key after rebuilding

A rebuilt guest can legitimately have a different SSH host key. Before changing your known-hosts entry, verify that the VM was actually destroyed and recreated and that you are connecting to the expected address and forwarded port. Only then remove the stale key entry using your SSH known-hosts tool and reconnect. If you did not intentionally rebuild the VM, treat the warning as a security event instead of suppressing it.

The command works for one account but not another

Vagrant plugins, SSH configuration and libvirt permissions are user-sensitive. Run the lifecycle commands as the account that installed the plugin, confirm that this account belongs to libvirt, and avoid alternating between a regular user and root. A root-created project can also leave ownership and box-cache problems for the normal administrator.

A practical decision checklist

  • Capability: kvm-ok confirms that the VPS exposes the virtualization extensions needed for the KVM route.
  • Provider: Choose libvirt/KVM for the Ubuntu-server path unless the VPS specifically supports VirtualBox or another backend you require.
  • Installation: Install the provider engine, Vagrant and any required plugin; VirtualBox is never supplied automatically by Vagrant.
  • Compatibility: Select a box published for the chosen provider and architecture.
  • Networking: Expect libvirt NAT by default; design a bridge and firewall rules when external hosts must reach the guest.
  • Lifecycle: Use vagrant init, vagrant up, vagrant ssh, then vagrant halt or vagrant destroy according to whether the environment must be preserved.
  • Purpose: Keep Canonical’s public Ubuntu boxes in the local-development and testing category, not as an automatic production base.

Recommended order for a first deployment

  1. Confirm with the VPS provider that nested virtualization is allowed, then run kvm-ok.
  2. Install QEMU/KVM and libvirt-daemon-system, add the Vagrant user to libvirt, reconnect and install Vagrant plus vagrant-libvirt.
  3. Choose a libvirt-compatible Ubuntu box and create a project directory.
  4. Run vagrant init, inspect the generated Vagrantfile and launch with vagrant up --provider=libvirt.
  5. Connect with vagrant ssh, test the service locally, then decide whether NAT is enough or a bridge and additional firewall work are required.
  6. Halt the VM when you need to preserve it; destroy it only after backing up anything that is not reproducible.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.