Home > Blockchain >  I have a vagrant file which is throwing an error on executing vagrant up
I have a vagrant file which is throwing an error on executing vagrant up

Time:04-28

I'm new to using vagrantfile. I created the sample file with the following content:

Vagrant.configure("2") do |config|
  config.vm.box = "chenhan/ubuntu-desktop-20.04"
  config.vm.provider :virtualbox do |v|
   v.memory  = 8096
   v.cpus    = 4
   v.customize ["modifyvm", :id, "--vram", "128mb"]
end
end

On executing vagrant up command, it gives an error

PS C:\Users\Anvay\Documents\Vagrant\ubuntu2004> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'chenhan/ubuntu-desktop-20.04' version '20200424' is up to date...
==> default: Clearing any previously set forwarded ports...
==> 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...
A customization command failed:

["modifyvm", :id, "--vram", "128mb"]

The following error was experienced:

#<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "7b4c021b-b083-4c05-a194-c07d22f04ab4", "--vram", "128mb"]

Stderr: Oracle VM VirtualBox Command Line Management Interface Version 6.1.34
(C) 2005-2022 Oracle Corporation
All rights reserved.

I'm new to this VagrantFile and I'm unable to understand the reason behind this.

CodePudding user response:

You only need the value, it is assumed to be in mb already, from docs : [--vram <vramsize in MB>]

Vagrant.configure("2") do |config|
  config.vm.box = "chenhan/ubuntu-desktop-20.04"
  config.vm.provider :virtualbox do |v|
   v.memory  = 8096
   v.cpus    = 4
   v.customize ["modifyvm", :id, "--vram", "128"]
  end
end
  • Related