From f95fde5cf7e4c3cf33bcf881d37d6074fd7b4807 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Thu, 31 Mar 2022 15:56:45 +0200 Subject: [PATCH] Patch for vbox resolution problems rendering vms unusable --- go.sum | 1 - virtual/vbox/vbox.go | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index 806e9e8d..4456d1f5 100644 --- a/go.sum +++ b/go.sum @@ -64,7 +64,6 @@ github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/virtual/vbox/vbox.go b/virtual/vbox/vbox.go index 95c2699d..1281a438 100644 --- a/virtual/vbox/vbox.go +++ b/virtual/vbox/vbox.go @@ -129,6 +129,14 @@ func (vm *vm) Start(ctx context.Context) error { Str("ID", vm.id). Msg("Started VM") + log.Debug(). + Str("ID", vm.id). + Msg("Setting resolution for VM") + _, err = VBoxCmdContext(ctx, vboxCtrlVM, vm.id, "setvideomodehint", "1920", "1080", "16") + if err != nil { + log.Error().Str("ID", vm.id).Msgf("Error setting resolution, VM may require reset on after connecting: %s", err.Error()) + } + return nil }