From 10543cb50626d4b20958a0d8acabe37113f3f431 Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 2 Apr 2023 10:05:06 +0200 Subject: [PATCH] Don't create vm till it's still there during rebuild --- box.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/box.py b/box.py index 70e9691..9c9f07f 100755 --- a/box.py +++ b/box.py @@ -1445,6 +1445,13 @@ def vmrebuild(args): conf.disk_size = vbox.get_media_size(disk_path) vmdestroy(args) + + # Wait till VM is gone + while True: + vbox = VBoxManage(args.name) + if not vbox.get_vm_info(): + break + vmcreate(args, conf) return 0