Setting VM name or description from Vagrantfile ? #1126

Adirelle opened this Issue Sep 14, 2012 · 10 comments


None yet

10 participants


Would it be possible to have some options in Vagrantfile to modify the name template used by vagrant when creating the VM ? This would help finding the VM from different projects in the VirtualBox Manager GUI.

This could be handy since VirtualBox 4.2 eventually allow to manage headless VMs.

(By the way, an option to push the actual port forwarding and shared folder settings into the VM description could be very useful.)


+1 for this.

axsuul commented Sep 16, 2012

In the meantime, you can set the name manually like this

config.vm.customize ["modifyvm", :id, "--name", "Gangnam Style"]




juozasg commented Dec 3, 2012



Finally shipped this. Vagrant 1.1 offers a great framework for making provider-specific changes like this. In 1.1 Vagrantfile syntax this will look like this:

Vagrant.configure("2") do |config|
  # ... stuff

  config.vm.provider :virtualbox do |vb| = "my_machine"

Enjoy! Will be available in 1.1.

@mitchellh mitchellh closed this Jan 31, 2013
kris-o3 commented Feb 3, 2014

figured out how to manage to do this with individually-named vm's (multi-vm setup)...

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

    config.vm.define "centos" do |centos| = "centos"
        config.vm.provider :virtualbox do |vb|
   = "centos"

MeanEYE commented Aug 21, 2014

Sorry for bringing attention to this old issue. I am considering of dynamically naming VM the same name as parent directory. Are there any downsides to this?

kikitux commented Aug 21, 2014

Mailing list is best suited for these questions.

no downsides, just avoid duplicates.

MeanEYE commented Aug 21, 2014

Okay sorry. Quick search turned this relevant thread up.

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