Skip to content

Instantly share code, notes, and snippets.

@Bubblemelon
Last active July 27, 2018 17:13
Show Gist options
  • Save Bubblemelon/bd9f3cf429d9e04be52f9987baed53c8 to your computer and use it in GitHub Desktop.
Save Bubblemelon/bd9f3cf429d9e04be52f9987baed53c8 to your computer and use it in GitHub Desktop.
Launching an Atomic Host VM using Vagrant

Launching an Atomic Host Virtual Machine

Follow these installation guides for: Vagrant on Fedora


There's two ways of creating a Vagrant VM:

From scratch using an image file OR Using an image from Vagrant Cloud.

See Overall Commands for contrast.

Skip this step if the image will be pulled from Vagrant Cloud. Go to Pulling an Image from Vagrant Cloud

Otherwise, download a vagrant-libvirt.box from source or through this link.

Within the same directory as the downloaded image or specify the path to the image file, run:

$ vagrant box add --name AH28 Fedora-AtomicHost-Vagrant-28-20180709.0.x86_64.vagrant-libvirt.box
.
.
box: Successfully added box 'AH28' (v0) for 'libvirt'!

This is where, Vagrantfile, the VM's configs, directories and etc will live.

On any directory that you prefer, run:

$ mkdir atomic && cd atomic

If you've created a Vagrant Box from scratch skip Pulling an Image from Vagrant Cloud and go to Creating an Atomic Host VM and Get it Running.

After creating a directory for the VM's Vagrantfile, the following commands will pull the Atomic Host image, create the VM and get it running:

$ vagrant init fedora/28-atomic-host && vagrant up

Source to Vagrant Box hosted on Vagrant Cloud.

If you've skipped Pulling an Image from Vagrant Cloud, run:

vagrant init AH28 && vagrant up
Launching Vagrant from a Custom Vagrant Box Using Vagrant Cloud
$ vagrant box add --name BoxName some-image.vagrant-libvirt.box
$ mkdir atomic && cd atomic
$ vagrant init BoxName && vagrant up
$ mkdir atomic && cd atomic
vagrant init fedora/28-atomic-host && vagrant up
$ vagrant ssh

To see more information about the VM's ssh configuration, run:

$ vagrant ssh-config
Host default
  HostName 192.168.121.131
  User vagrant
  Port 22
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no

This error may show up,

$ vagrant up 
Bringing machine 'default' up with 'libvirt' provider...
Name `atomic_default` of domain about to create is already taken. Please try to run `vagrant up` command again.

This happens when the directory named atomic had a VM created in it but was later vagrant destroy -ed and then a different VM was created within the same atomic directory.

The workaround, as show on this github discussion:

Change the following in the Vagrantfile from

.
.
config.vm.define "atomic_default" do |atomic_default|
end
.
.

to:

config.vm.define "atomic_default" do |atomic_28|
end

Stackoverflow discusion on changing default machine name.

An error relating to Mounting NFS shared folders for sharing files between the VM and hosting machine, may happen.

Un-comment the following line in the Vagrantfile and add , disabled:true as such:

.
.
config.vm.synced_folder ".", "/vagrant", disabled: true
.
.

See the workaround and discussion here.

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