0

Q1: How much hard drive space is available during vagrant up?

Q2: Can I increase the disk space available when running vagrant up?

Background: I'm working on a Vagrantfile that creates a Cent OS 7 VM to use in Hyper-V. When configuring the VM, I use the vagrant-disksize plugin to expand the size of the virtual hard drive, I clone a git repo containing a node project, and try to run npm install. I am trying to get the node project ready for me to work with when the VM is create. I have plenty of physical disk space and vagrant-disksize does successfully increase my maximum virtual disk space (verified using Hyper-V Manager)

The Issue: When running npm install on the node project I have cloned, I encounter this error `

my-vm: npm install
...
my-vm:  ENOTSUP: operation not supported on socket, symlink '../typescript/bin/tsc' -> '/vagrant/my-project/client/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsc'

my-vm: npm

my-vm: ERR!

my-vm:  nospc

my-vm:  There appears to be insufficient space on your system to finish.

my-vm: npm

my-vm: 

my-vm: ERR!

my-vm: 

my-vm: nospc

my-vm:  Clear up some disk space and try again.

my-vm: npm

my-vm: verb

my-vm:  exit

my-vm:  [ -95, true ]

...

Vagrantfile:

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

  # Setting some configs
  …

  # installs the Vagrant DiskSize plugin
  system "vagrant plugin install ./vagrant-disksize-0.1.2.gem --plugin-clean-sources"

  config.vm.define vm_name = "my-vm"
  config.vm.box = "centosbuilder"
  config.disksize.size = "40GB"

  …

  config.vm.provision :shell, :inline => \
  "
  # Get sudo privileges
  sudo su

  # yum install Node.js
  …

  # Install global node packages
  …

  # Clone GUI repo
  sudo git clone ssh://git@my-server/my-project.git

  # Setup the project
  sudo chmod -R 700 my-project
  cd my-project
  sudo npm install
  "
end
hededo
  • 371
  • 2
  • 16

1 Answers1

1

"The plugin only works with VirtualBox but it will issue an error message and then disable itself if you try to use it with another provider." In other words, not with Hyper-V.

You might be able to find a box with a larger disk size already configured in? I haven't had any problem using node on standard ubuntu boxes for instance.

  • You're right. By complete coincidence I was trying to set the disk size to the max value already defined. I will look into getting another VM with more disk space. – hededo Sep 17 '18 at 16:17
  • I wish this was the sort of info that was easily available for boxes... But at least it's good if you have a better standard to look for – George M Reinstate Monica Sep 17 '18 at 16:56