临时解决 vagrant 不支持 virtualbox7.1

介绍一种临时解决 Recent version of Virtualbox 7.1.0 is not supported by vagrant 2.4.1 的方法:

解决方案

方案一

$ sudo viVirtualBoxVM|virtualboxvm)
     VBoxManage|vboxmanage)
-        exec "$INSTALL_DIR/VBoxManage" "$@"
+    if [[ $@ == "--version" ]]; then
+      echo "7.0.0r164728"
+    else
+          exec "$INSTALL_DIR/VBoxManage" "$@"
+    fi
         ;;
     VBoxSDL|vboxsdl)
         exec "$INSTALL_DIR/VBoxSDL" "$@"

方案二

$ sudo vim /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/virtualbox/driver
$ diff -u meta.rb.orig meta.rb
--- meta.rb.orig        2024-09-16 11:37:37.017440100 +0100
+++ meta.rb     2024-09-16 11:33:51.312254400 +0100
@@ -69,6 +69,7 @@
             "6.0" => Version_6_0,
             "6.1" => Version_6_1,
             "7.0" => Version_7_0,
+            "7.1" => Version_7_0,
           }

           if @@version.start_with?("4.2.14")

References

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容