« Back to projectatomic.io
Ask Your Question

Vagrant support

asked 2014-08-13 23:47:40 +0000

ugol gravatar image

Is a Vagrant image similar to coreos [1] in plan?


[1] https://coreos.com/blog/coreos-vagrant-images/

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-15 13:46:20 +0000

Andre Fernandes gravatar image

updated 2014-08-21 01:19:57 +0000

I have managed to manually produce an "atomic-base-box". Starting from the VDI distributed by Project Atomic, create and boot a regular hand-made VM on VirtualBox (Fedora 64 type). Follow the steps below:

  1. Download the VDI file (currently "20140609.vdi")
  2. Create a VM "atomic-base.vbox" named "atomic-base" using this VDI file as primary disk. Boot the VM, login as root (no password is the default)
  3. Create a "vagrant" user, password "vagrant":

    useradd vagrant

    passwd vagrant

    (answer "vagrant")

  4. Change root password to "vagrant"


    (answer "vagrant")

  5. Configure sudo with no password for "vagrant" user:


    (insert the line below in the file visudo edits)

    vagrant ALL=(ALL) NOPASSWD: ALL

  6. Download the "vagrant.pub" file from https://github.com/mitchellh/vagrant/tree/master/keys and rename it to "authorized keys" and copy it into the VM as "~vagrant/.ssh/authorizedkeys" (crate folder ".ssh" if needed). You will have to adjust permissions after that (see below). DO IT AS "vagrant" (NOT root)! [[HINT: enable port forwarding in the VM on VirtualBox console, so you can scp/ssh into the VM, that will make copying files into it a breeze with a tool like WinSCP]].

    [use scp whatever you have to copy the key file into the VM]

    chmod 0700 ~vagrant/.ssh

    chmod 0600 ~vagrant/.ssh/authorized_keys

  7. Remove pesky demands of tty from "vagrant". Mind the single quotes so shell ignores the "!" thingie:

    echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/999-vagrant-not-requiretty

    chmod 440 /etc/sudoers.d/999-vagrant-not-requiretty

  8. Uncomment/insert/edit these lines in /etc/ssh/sshd_config (as root or sudo). This is important or SSH login takes ages:

    UseDNS no

    GSSAPIAuthentication no

  9. Shutdown the VM

  10. Package the new base box:

    vagrant package --base atomic-base --output atomic-base.box

  11. (OPTIONAL) Remove a previously failed attempt that might be in the system:

    vagrant box remove atomic-base virtualbox

  12. Add the new base box to your system:

    vagrant box add atomic-base atomic-base.box

Eventually all this could be done with "packer", but I am happy this way.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2014-08-13 23:47:40 +0000

Seen: 1,027 times

Last updated: Aug 21 '14