Skip to content

Provision reproducible and consistent Ubuntu desktop virtual machines using Vagrant and VirtualBox.

Notifications You must be signed in to change notification settings

brlin-tw/ubuntu-desktop-vagrant

Repository files navigation

Ubuntu Desktop in Vagrant

Provision reproducible and consistent Ubuntu desktop virtual machines using Vagrant and VirtualBox.

Example post-installation screenshot

https://gitlab.com/brlin/ubuntu-desktop-vagrant
The GitLab CI pipeline status badge of the project's main branch GitHub Actions workflow status badge pre-commit enabled badge REUSE Specification compliance badge

Features

In order to improve the out-of-the-box user experience, this product introduces changes including but not limited to:

  • Disable features that are not useful in the virtual machine use case (suspend, user authentications, and lock screens).
  • Workaround known bugs in the VirtualBox guest drivers.
  • Reduced boot time by optimizing VM configurations.
  • Improved default console size and aspect ratio.
  • Suppress unnecessary input-capturing warning user interfaces.
  • Include common Vagrantfile template configuration for further customizations.
  • Support configuring localization and default input method for the following locales:

Prerequisites

The following prerequisites must be satisfied in order to use this solution:

  • The host system must have the following software installed and has its commands available in the command search PATHs:
    • OPTIONAL - (Your preferred archive extraction application/utility)
      For extracting the downloaded product release archive.
    • OPTIONAL - (Your preferred HTTPS client/Web browser)
      For downloading the product release archive.
    • Vagrant
      For provisioning the virtual machine that runs the Ubuntu desktop environment.
    • Oracle VirtualBox(must be in a version that your Vagrant installation supports, as of 2024/10/25 it is 7.0.*)
  • The host system must have access to the Internet in order to retrieve the virtual machine image and other guest packages.

Usage

Follow the following instructions to use this solution:

  1. Download the product release archive from the Releases page.

  2. Extract the product release archive.

  3. Launch a text terminal.

  4. Change the working directory to the extracted product release directory by running the following command:

    cd /path/to/ubuntu-desktop-vagrant-X.Y.Z
  5. Review and, when necessary, edit the Vagrantfile to satisfy your requirements. Refer to the Environment variables that can change the behavior of the provision program section for settings that can customize some of the VM provisioning details.

  6. Run the following command to provision the Ubuntu desktop virtual machine:

    vagrant up

    A VM console window should popup, allowing you to operate the desktop environment.

    You can also run the following command to gain access to a text shell:

    vagrant ssh
  7. OPTIONAL: Run the following command to destroy the virtual machine:

    vagrant destroy

    All data will be lost after the operation.

Environment variables that can change the behavior of the provision program

The following are the environment variables that can change the behavior of the provision program, which can be set in the config.vm.provision :shell, path: "vagrant-assets/provision.sh" call in the Vagrantfile:

ENABLE_KMSCON

Whether to install KMSCON and configure it to be the default virtual console implementation.

Setting this to true allows display of non-ASCII characters in the virtual console. Note that CJKV text input is still unsupported at the moment.

Supported values:

  • true
  • false

Default value: false

ENABLE_VBOXADD_INSTALLATION

Whether to re-install the VirtualBox Guest Additions, which should fix some problems of the guest support drivers from the distribution installation.

Setting the value of this environment variable to false can reduce the time required for re-provisioning the system.

Supported values:

  • true
  • false

Default value: true

INSTALL_LANGUAGE_SUPPORT

Specify whether to install language support packages, and if it should be installed, which locale should be used.

Supported values:

  • null: Don't install language support packages
  • Values supported by the -l option of the check-langauge-support command:
    • ll
    • lll
    • ll_CC
    • lll_CC
    • ll@variant
    • lll@variant
    • ll_CC@variant
    • lll_CC@variant
    • zh-hans
    • zh-hant

Default value: null

Credits

We would like to express our gratitude to Yoshimasa Niwa, who implemented and published the original implementation.

References

The following material are referenced during the development of this project:

Licensing

Unless otherwise noted(individual file's header/REUSE.toml), this product is licensed under the MIT license.

This work complies to the REUSE Specification, refer the REUSE - Make licensing easy for everyone website for info regarding the licensing of this product.