Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1145  / 1 Year ago, sat, december 10, 2022, 12:55:18

When I try to shutdown my machine, it "freezes" or it stays stuck on one point, where it can not complete the process. I get the message



unregistered_netdevice: waiting for vboxnet2 to become free. Usage count = 1


After some experimentation I have noticed that if I halt the vagrant boxes, this error does not happen.



vagrant halt


This is a new behaviour that started a couple weeks ago. How could I fix this?


More From » virtualbox

 Answers
1

You'll need to setup a script to automatically run on shutdown.



See https://askubuntu.com/a/564674



Create /etc/init.d/vagrant with this content:



#!/bin/bash
vagrant global-status | awk '/running/{print $1}' | xargs -r -d '
' -n 1 -- vagrant suspend


Make it executable and link it into the shutdown run modes:



chmod +x /etc/init.d/vagrant
ln -s /etc/init.d/vagrant /etc/rc0.d/K10vagrant
ln -s /etc/init.d/vagrant /etc/rc6.d/K10vagrant


You can test it by starting some vagrant VM's and then running the script as root:



sudo /etc/init.d/vagrant

[#22787] Sunday, December 11, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alliulet

Total Points: 46
Total Questions: 109
Total Answers: 97

Location: Svalbard and Jan Mayen
Member since Sat, Oct 10, 2020
4 Years ago
;