Reputation: 12395
I am trying to set the VM displayname in vmware via Vagrant:
Here is my Vagrantfile:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
config.vm.provider :vmware_workstation do |vb|
vb.name = "my_crazy_vm_name_rulezz"
end
end
But the vmware Machine name still defaults to "vm: default"
What am I doing wrong?
Upvotes: 1
Views: 2276
Reputation: 231
Each provider is configured completely differently. What you're doing there is trying to use the VirtualBox's configuration .name
to set something in VMWare, where there is no such "name" attribute. In VMWare there are only two things you can set (as far as I know), which are:
.gui = true/false # Enables/disables display of the VMWare GUI when you start this VM
.vmx['key'] = 'value' # Sets a value in the .vmx file for this VM
The .vmx configuration is what you're looking for, since it has a handy 'displayname' key. SO... here's the configuration you're looking for
config.vm.provider :vmware_workstation do |v|
v.vmx['displayname'] = 'My Custom VM Name'
end
You can find other values you can configure this way by looking at the .vmx file for your VM in a text editor. This file can be found at: .vagrant/machines/default/vmware_workstation/{some_big_id}/{something}.vmx
Upvotes: 4