Skip to content

Instantly share code, notes, and snippets.

@niw
Last active November 28, 2024 20:27
Show Gist options
  • Save niw/bed28f823b4ebd2c504285ff99c1b2c2 to your computer and use it in GitHub Desktop.
Save niw/bed28f823b4ebd2c504285ff99c1b2c2 to your computer and use it in GitHub Desktop.
A simple Vagrantfile to setup Ubuntu desktop environment with Google Chrome and Japanese input
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider :virtualbox do |v|
v.gui = true
v.memory = 2048
end
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"`
# to make synced folder works.
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
# Add Google Chrome repository
config.vm.provision :shell, inline: "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub|sudo apt-key add -"
config.vm.provision :shell, inline: "sudo sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" > /etc/apt/sources.list.d/google.list'"
# Update repositories
config.vm.provision :shell, inline: "sudo apt update -y"
# Upgrade installed packages
config.vm.provision :shell, inline: "sudo apt upgrade -y"
# Add desktop environment
config.vm.provision :shell, inline: "sudo apt install -y --no-install-recommends ubuntu-desktop"
config.vm.provision :shell, inline: "sudo apt install -y --no-install-recommends virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11"
# Add `vagrant` to Administrator
config.vm.provision :shell, inline: "sudo usermod -a -G sudo vagrant"
# Add Google Chrome
config.vm.provision :shell, inline: "sudo apt install -y google-chrome-stable"
# Add Chromium
config.vm.provision :shell, inline: "sudo apt install -y chromium-browser"
# Add Firefox
config.vm.provision :shell, inline: "sudo apt install -y firefox"
# Add Japanese support
config.vm.provision :shell, inline: "sudo apt install -y fcitx-mozc"
config.vm.provision :shell, inline: "sudo apt install -y fonts-noto"
# Restart
config.vm.provision :shell, inline: "sudo shutdown -r now"
end
@santiagomoneta
Copy link

Im starting to work with Vagrant.. Thanks for this code.. is just what I needed!

@rtorres90
Copy link

thx

@zarinfam
Copy link

zarinfam commented Mar 2, 2023

Thanks.

@gritness
Copy link

Thank you.

@earlpearl17
Copy link

Thanks.

@brlin-tw
Copy link

Hello. I would like to request declaring a license for this work to avoid legal compliance issues, thanks!

@niw
Copy link
Author

niw commented Oct 24, 2024

@brlin-tw It’s just a config and so not having any legal matters I believe however, I declare it’s under MIT license.

Copyright (c) 2019 Yoshimasa Niwa

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@brlin-tw
Copy link

@niw Thanks for your prompt response, appreciated!

@brlin-tw
Copy link

Hello all, I have made a fork of the Vagrantfile, migrated it to Ubuntu 24.04, and implemented several changes to improve the overall usage of the provisioned VM: https://gitlab.com/brlin/ubuntu-desktop-vagrant

Feel free to check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment