Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it could run Centos Image with Arm64 ? #22

Open
Febregaz opened this issue Jul 20, 2021 · 5 comments
Open

Does it could run Centos Image with Arm64 ? #22

Febregaz opened this issue Jul 20, 2021 · 5 comments

Comments

@Febregaz
Copy link

Febregaz commented Jul 20, 2021

I use the Centos Image file and This is my error :
VM start error: Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine failed to start.}

@Febregaz
Copy link
Author

sudo /usr/local/vftool/vftool/build/vftool -k /Volumes/Centos/images/pxeboot/vmlinuz -d CentOS-7-aarch64-Minimal-2009.iso -m 4096 -a "console=hvc0"
Password:
2021-07-21 01:18:07.806 vftool[74180:6580054] vftool (v0.3 10/12/2020) starting
2021-07-21 01:18:07.806 vftool[74180:6580054] +++ kernel at /Volumes/Centos/images/pxeboot/vmlinuz, initrd at (null), cmdline 'console=hvc0', 1 cpus, 4096MB memory
2021-07-21 01:18:07.806 vftool[74180:6580054] +++ fd 3 connected to /dev/ttys004
2021-07-21 01:18:07.806 vftool[74180:6580054] +++ Waiting for connection to: /dev/ttys004
2021-07-21 01:18:38.877 vftool[74180:6580054] +++ Attaching disc CentOS-7-aarch64-Minimal-2009.iso
2021-07-21 01:18:38.877 vftool[74180:6580054] +++ Configuration validated.
2021-07-21 01:18:38.877 vftool[74180:6580054] +++ canStart = 1, vm state 0
2021-07-21 01:18:38.919 vftool[74180:6580304] --- VM start error: Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine failed to start.}

@Febregaz
Copy link
Author

M1 Macbook Pro

@kenji21
Copy link

kenji21 commented Oct 22, 2021

same error (but with debian netinstall) using vmcli

@kenji21
Copy link

kenji21 commented Oct 22, 2021

Downloaded https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-arm64.tar.xz, mounted it on a linux to get vmlinuz/initrd files, then:

~/github/vftool/build/vftool  -k debian-cloud/vmlinuz-5.10.0-9-arm64 -i debian-cloud/initrd.img-5.10.0-9-arm64 -d debian-cloud/disk.img  -a "console=tty0 console=hvc0 root=/dev/vda1 ds=nocloud"
2021-10-22 11:06:20.768 vftool[8968:134340] vftool (v0.3 10/12/2020) starting
2021-10-22 11:06:20.769 vftool[8968:134340] +++ kernel at debian-cloud/vmlinuz-5.10.0-9-arm64, initrd at debian-cloud/initrd.img-5.10.0-9-arm64, cmdline 'console=tty0 console=hvc0 root=/dev/vda1 ds=nocloud', 1 cpus, 512MB memory
2021-10-22 11:06:20.769 vftool[8968:134340] +++ fd 3 connected to /dev/ttys013
2021-10-22 11:06:20.769 vftool[8968:134340] +++ Waiting for connection to:  /dev/ttys013
2021-10-22 11:07:36.646 vftool[8968:134340] +++ Attaching disc debian-cloud/disk.img
2021-10-22 11:07:36.646 vftool[8968:134340] +++ Configuration validated.
2021-10-22 11:07:36.646 vftool[8968:134340] +++ canStart = 1, vm state 0
2021-10-22 11:07:36.675 vftool[8968:143271] --- VM start error: Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine failed to start.}

:/

@kenji21
Copy link

kenji21 commented Oct 22, 2021

finally got it working \o/

~/github/vftool/build/vftool  -k debian-cloud/vmlinuz-5.10.0-9-arm64 -i debian-cloud/initrd.img-5.10.0-9-arm64 -d debian-cloud/disk.raw  -a "console=tty0 console=hvc0 root=/dev/vda1 ds=nocloud"
2021-10-22 11:35:41.634 vftool[14290:167957] vftool (v0.3 10/12/2020) starting
2021-10-22 11:35:41.635 vftool[14290:167957] +++ kernel at debian-cloud/vmlinuz-5.10.0-9-arm64, initrd at debian-cloud/initrd.img-5.10.0-9-arm64, cmdline 'console=tty0 console=hvc0 root=/dev/vda1 ds=nocloud', 1 cpus, 512MB memory
2021-10-22 11:35:41.635 vftool[14290:167957] +++ fd 3 connected to /dev/ttys015
2021-10-22 11:35:41.635 vftool[14290:167957] +++ Waiting for connection to:  /dev/ttys015
2021-10-22 11:36:21.324 vftool[14290:167957] +++ Attaching disc debian-cloud/disk.raw
2021-10-22 11:36:21.324 vftool[14290:167957] +++ Configuration validated.
2021-10-22 11:36:21.325 vftool[14290:167957] +++ canStart = 1, vm state 0
2021-10-22 11:36:21.497 vftool[14290:168699] +++ VM started

And another terminal with minicom -D /dev/ttys015 shows the guest console

The issue was.... vftool binary arch:

file build/vftool
build/vftool: Mach-O 64-bit executable x86_64
diff --git a/Makefile b/Makefile
index d019003..18d5630 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ prep:
        mkdir -p build/

 build/vftool:  vftool/main.m
-       clang $(CFLAGS) $< -o $@ $(FWKS)
+       clang -arch arm64 $(CFLAGS) $< -o $@ $(FWKS)

 .PHONY: sign
 sign:  build/vftool

Run make, then:

file build/vftool
build/vftool: Mach-O 64-bit executable arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants