Vagrant debian Stretch 9.4 for Symfony dev
I choose to have a parent directory for my vagrant projects, -p or –parents tells mkdir to create all the needed parent folders.
mkdir -p vagrant/myproject
cd vagrant/myproject
vagrant init
vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Edit Vagrantfile:
In the Vagrantfile you have this by default:
config.vm.box = "base"
edit to use the box you choose, I choose this one https://app.vagrantup.com/debian/boxes/stretch64:
info: mainpage of debian boxes https://app.vagrantup.com/debian
config.vm.box = "debian/stretch64"
vagrant up
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'debian/stretch64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'debian/stretch64'
default: URL: https://vagrantcloud.com/debian/stretch64
==> default: Adding box 'debian/stretch64' (v9.4.0) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/debian/boxes/stretch64/versions/9.4.0/providers/virtualbox.box
==> default: Successfully added box 'debian/stretch64' (v9.4.0) for 'virtualbox'!
==> default: Importing base box 'debian/stretch64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'debian/stretch64' is up to date...
==> default: Setting the name of the VM: myproject_default_1523353141366_70143
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Installing rsync to the VM...
==> default: Rsyncing folder: /var/www/myfolder/vagrant/myproject/ => /vagrant
==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: Vanilla Debian box. See https://app.vagrantup.com/debian for help and bug reports
- « vagrant ssh » to log in your new virtual machine
- « exit » to logout
- « vagrant destroy » to stop the virtual machine
Categories: Blog