macvz icon indicating copy to clipboard operation
macvz copied to clipboard

Failed to run example docker instance

Open jjaychen1e opened this issue 2 years ago • 25 comments

Describe the bug FATA[0015] hostagent ("/Users/jjaychen/.macvz/docker/vz.pid") did not start up in 15s (hint: see "/Users/jjaychen/.macvz/docker/ha.stderr.log")

To Reproduce Run macvz start https://raw.githubusercontent.com/mac-vz/macvz/main/examples/docker.yaml, or mccvc start docker

Versions (please complete the following information):

  • macOS: 12.4
  • macvz 0.0.3

Additional context

{"level":"fatal","msg":"stat /Users/jjaychen/.macvz/_config/user: no such file or directory","time":"2022-07-13T23:32:10+08:00"}

jjaychen1e avatar Jul 13 '22 15:07 jjaychen1e

@JJAYCHEN1e Thanks for raising bug.

Could you please also share if its intel or m1 mac

balajiv113 avatar Jul 13 '22 15:07 balajiv113

@balajiv113 Thanks for replying, I'm using a M1 Mac.

jjaychen1e avatar Jul 13 '22 15:07 jjaychen1e

Thanks for the info. Will check and let you know

balajiv113 avatar Jul 13 '22 16:07 balajiv113

I found a bug in code which looked for ssh private key before it is generated.

I have just released a new version v0.0.4. Could you try with that please :)

To update, just running brew install macvz again is sufficient

balajiv113 avatar Jul 13 '22 17:07 balajiv113

@balajiv113 I've tried v0.0.4, I got another error when run macvz start https://raw.githubusercontent.com/mac-vz/macvz/main/examples/docker.yaml:

INFO[0000] Using cache "/Users/jjaychen/Library/Caches/lima/download/by-url-sha256/358295da728c41e4057ee8ec8dc2c32bdcdd68f0e5807d5a1a85e3d066aab5b1/data"
INFO[0000] Using cache "/Users/jjaychen/Library/Caches/lima/download/by-url-sha256/3600f143c75230ab3a3ae85c2435df4e518ebd0c3228227f317ff4598fcea6b7/data"
INFO[0000] Using cache "/Users/jjaychen/Library/Caches/lima/download/by-url-sha256/1a321ff82ac77f52fbb71a1f52b01a645be50aa980ea0e8f701e506a8f7e69f7/data"
FATA[0027] hostagent ("/Users/jjaychen/.macvz/docker/vz.pid") did not start up in 15s (hint: see "/Users/jjaychen/.macvz/docker/ha.stderr.log")

log:

{"level":"debug","msg":"executing [ssh-keygen -t ed25519 -q -N  -f /Users/jjaychen/.macvz/_config/user]","time":"2022-07-14T11:56:50+08:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-14T11:56:50+08:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-14T11:56:50+08:00"}
{"level":"info","msg":"Waiting for the host requirement 1 of 1: \"Host IP Bind\"","time":"2022-07-14T11:56:50+08:00"}
{"level":"debug","msg":"executing script \"Host IP Bind\"","time":"2022-07-14T11:56:50+08:00"}
{"level":"info","msg":"in start: Error Domain=VZErrorDomain Code=1 Description=\"Internal Virtualization error. The virtual machine failed to start.\" UserInfo={\n    NSLocalizedFailure = \"Internal Virtualization error.\";\n    NSLocalizedFailureReason = \"The virtual machine failed to start.\";\n}","time":"2022-07-14T11:56:50+08:00"}
{"level":"fatal","msg":"RUNerror during start of VM","time":"2022-07-14T11:56:50+08:00"}

I also tried to remove ~/.macvz and uninstall & install macvc, still the same error.

jjaychen1e avatar Jul 14 '22 03:07 jjaychen1e

Ah !! Thanks for checking it out.

Let me take a look again. I tried 0.0.4 with Intel, things were smooth again. Will give a shot with M1 and get back on this

BalajiVijayakumar1195 avatar Jul 14 '22 04:07 BalajiVijayakumar1195

Also if possible could you please share the log under ~/.macvz/docker/vz.stderr.log

balajiv113 avatar Jul 14 '22 04:07 balajiv113

Also if possible could you please share the log under ~/.macvz/docker/vz.stderr.log

I'm sorry, it's empty. I upload all log files under ~/.macvz/docker/ here:

ha.stderr.log ha.stdout.log vz.stderr.log vz.stdout.log

jjaychen1e avatar Jul 14 '22 04:07 jjaychen1e

@JJAYCHEN1e Sorry for the trouble again :) Can you give a try now. Did a new release to fix the issue.

The issue was, for m1 mac the kernel, disk images should be arm one. But it was picking amd images.

balajiv113 avatar Jul 14 '22 06:07 balajiv113

@JJAYCHEN1e Sorry for the trouble again :) Can you give a try now. Did a new release to fix the issue.

The issue was, for m1 mac the kernel, disk images should be arm one. But it was picking amd images.

It's almost the same(version 0.0.4-1):

...
INFO[0181] Downloaded image from "https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.tar.gz"
FATA[0214] hostagent ("/Users/jjaychen/.macvz/docker/vz.pid") did not start up in 15s (hint: see "/Users/jjaychen/.macvz/docker/ha.stderr.log")

ha.stderr.log ha.stdout.log vz.stderr.log vz.stdout.log

jjaychen1e avatar Jul 14 '22 07:07 jjaychen1e

Hope you have tried by removing the ~/.macvz folder. If not could you give a try once.

balajiv113 avatar Jul 14 '22 07:07 balajiv113

Hope you have tried by removing the ~/.macvz folder. If not could you give a try once.

I tried again, but I got the same log. Thanks for you patience!!

jjaychen1e avatar Jul 14 '22 07:07 jjaychen1e

Thanks a lot for testing 👍

Will do a full test with M1 and let you know ASAP.

balajiv113 avatar Jul 14 '22 07:07 balajiv113

I'd like to get someone else to confirm this, but @JJAYCHEN1e if, per chance, you're running the latest macOS 13 Beta, I believe this might be an issue with VZLinuxBootLoader itself in this release

0xADD1E avatar Jul 19 '22 22:07 0xADD1E

I'd like to get someone else to confirm this, but @JJAYCHEN1e if, per chance, you're running the latest macOS 13 Beta, I believe this might be an issue with VZLinuxBootLoader itself in this release

I'm using macOS 12.4

jjaychen1e avatar Jul 20 '22 03:07 jjaychen1e

same error macOs 12.2.1 (M1) ha.stderr.log: {"level":"debug","msg":"executing [ssh-keygen -t ed25519 -q -N -f /Users/ivosights/.macvz/_config/user]","time":"2022-07-22T06:25:58+07:00"} {"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-22T06:25:58+07:00"} {"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-22T06:25:58+07:00"} {"level":"info","msg":"Waiting for the host requirement 1 of 1: \"Host IP Bind\"","time":"2022-07-22T06:25:58+07:00"} {"level":"debug","msg":"executing script \"Host IP Bind\"","time":"2022-07-22T06:25:58+07:00"} {"level":"info","msg":"in start: Error Domain=VZErrorDomain Code=1 Description=\"Internal Virtualization error. The virtual machine failed to start.\" UserInfo={\n NSLocalizedFailure = \"Internal Virtualization error.\";\n NSLocalizedFailureReason = \"The virtual machine failed to start.\";\n}","time":"2022-07-22T06:25:58+07:00"} {"level":"fatal","msg":"RUNerror during start of VM","time":"2022-07-22T06:25:58+07:00"}

daudcanugerah avatar Jul 21 '22 23:07 daudcanugerah

Thanks @daudcanugerah for double checking and verifying. Currently am stuck as I don't have a M1 to debug on. Looking for ways to debug. Will soon fix this.

balajiv113 avatar Jul 22 '22 04:07 balajiv113

@JJAYCHEN1e I hope it should work now. The ubuntu kernel for arm is compressed. Virtualization framework needs the kernel to be uncompressed.

Can you please try to do brew install macvz --head to install based on current main. I will do a release once its verified fixed.

balajiv113 avatar Jul 22 '22 06:07 balajiv113

ok i try

daudcanugerah avatar Jul 22 '22 07:07 daudcanugerah

  1. run brew install macvz --HEAD Warning: mac-vz/tap/macvz HEAD-a58360b is already installed and up-to-date.

  2. delete ~/.macvz and run macvz start https://raw.githubusercontent.com/mac-vz/macvz/main/examples/docker.yaml error: {"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-22T14:15:30+07:00"} {"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-22T14:15:30+07:00"} {"level":"fatal","msg":"failed to read ssh public key \"/Users/ivosights/.macvz/_config/user.pub\": open /Users/ivosights/.macvz/_config/user.pub: no such file or directory","time":"2022-07-22T14:15:30+07:

  3. run mkdir -p ~/.macvz/_config and copy local ssh.pub and run macvz start docker still same error {"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-22T14:16:13+07:00"} {"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-22T14:16:13+07:00"} {"level":"info","msg":"Waiting for the host requirement 1 of 1: \"Host IP Bind\"","time":"2022-07-22T14:16:13+07:00"} {"level":"debug","msg":"executing script \"Host IP Bind\"","time":"2022-07-22T14:16:13+07:00"} {"level":"info","msg":"in start: Error Domain=VZErrorDomain Code=1 Description=\"Internal Virtualization error. The virtual machine failed to start.\" UserInfo={\n NSLocalizedFailure = \"Internal Virtualization error.\";\n NSLocalizedFailureReason = \"The virtual machine failed to start.\";\n}","time":"2022-07-22T14:16:13+07:00"} {"level":"fatal","msg":"RUNerror during start of VM","time":"2022-07-22T14:16:13+07:00"}

daudcanugerah avatar Jul 22 '22 07:07 daudcanugerah

@daudcanugerah Please do brew reinstall macvz. Since its already installed on head it won't update the binary if we don't do reinstall

Thanks for trying it out :)

balajiv113 avatar Jul 22 '22 10:07 balajiv113

after reinstall macvz, still get same error {"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-22T20:03:18+07:00"} {"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-22T20:03:18+07:00"} {"level":"info","msg":"Waiting for the host requirement 1 of 1: \"Host IP Bind\"","time":"2022-07-22T20:03:18+07:00"} {"level":"debug","msg":"executing script \"Host IP Bind\"","time":"2022-07-22T20:03:18+07:00"} {"level":"info","msg":"in start: Error Domain=VZErrorDomain Code=1 Description=\"Internal Virtualization error. The virtual machine failed to start.\" UserInfo={\n NSLocalizedFailure = \"Internal Virtualization error.\";\n NSLocalizedFailureReason = \"The virtual machine failed to start.\";\n}","time":"2022-07-22T20:03:18+07:00"} {"level":"fatal","msg":"RUNerror during start of VM","time":"2022-07-22T20:03:18+07:00"}

daudcanugerah avatar Jul 22 '22 13:07 daudcanugerah

@daudcanugerah Same to me.

{"level":"debug","msg":"executing [ssh-keygen -t ed25519 -q -N  -f /Users/jjaychen/.macvz/_config/user]","time":"2022-07-22T19:55:12+08:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-07-22T19:55:12+08:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-07-22T19:55:12+08:00"}
{"level":"info","msg":"Waiting for the host requirement 1 of 1: \"Host IP Bind\"","time":"2022-07-22T19:55:12+08:00"}
{"level":"debug","msg":"executing script \"Host IP Bind\"","time":"2022-07-22T19:55:12+08:00"}
{"level":"info","msg":"in start: Error Domain=VZErrorDomain Code=1 Description=\"Internal Virtualization error. The virtual machine failed to start.\" UserInfo={\n    NSLocalizedFailure = \"Internal Virtualization error.\";\n    NSLocalizedFailureReason = \"The virtual machine failed to start.\";\n}","time":"2022-07-22T19:55:12+08:00"}
{"level":"fatal","msg":"RUNerror during start of VM","time":"2022-07-22T19:55:12+08:00"}

jjaychen1e avatar Jul 22 '22 16:07 jjaychen1e

@JJAYCHEN1e issues that may be related: https://github.com/utmapp/UTM/issues/4099

daudcanugerah avatar Jul 25 '22 11:07 daudcanugerah

@JJAYCHEN1e & @daudcanugerah I have now verified its working in mac m1.

There is still 1 issue /dev/rtc file is not created for arm instance for some reason due to this, apt update is failing.

You could start plain ubuntu (without install docker scripts) and install docker manually, this is working fine

balajiv113 avatar Aug 21 '22 13:08 balajiv113