-
Notifications
You must be signed in 8000 to change notification settings - Fork 185
Support for macOS Guest images (APFS)? #166
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
Comments
The lack of support for In general, it's possible, but it's a considerable amount of work. The first issue is that libguestfs inspection doesn't recognize macOS. It does already recognize many Linux distros and many Windows versions, so macOS is a logical extension, but it's not implemented right now. See: Inspection is the hard part. Adding sysprepping support for macOS to virt-sysprep would be relatively easy, if you know what kinds of files need to be deleted/reverted. |
A good question which I had also wondered about... Looks like someone asked this question. Their answer was:
So, it may not be anytime soon but hopefully some day.
Thanks! Makes a lot of sense, given the nature of config management and provisioning often requiring discovery tools (e.g. Puppet's It sounds like the support for this is in I guess for now I should try to simply disable this step, or manually "sysprep" the image by hand or with scripts. [1] details
$ virt-filesystems --all --long --uuid -a /tmp/lyraphase-runner-macos-monterey-12-1-base/box.img
Name Type VFS Label MBR Size Parent UUID
/dev/sda1 filesystem vfat EFI - 152346624 - 0E8C-E277
/dev/sda2 filesystem apfs - - 137094979584 - 88f32947-1c60-4f58-a51a-d7abc3f8e031
/dev/sda1 partition - - - 209715200 /dev/sda -
/dev/sda2 partition - - - 137094979584 /dev/sda -
/dev/sda device - - - 137438953472 - -
$ guestmount -a /tmp/lyraphase-runner-macos-monterey-12-1-base/box.img -m /dev/sda2 /tmp/guestfs-apfs-test
$ mount | grep -i apfs
/dev/fuse on /tmp/guestfs-apfs-test type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
$ ls -l /tmp/guestfs-apfs-test
total 0
drwxrwxr-x 1 root 80 0 Jan 2 2022 Applications
drwxr-xr-x 1 root root 0 Dec 7 2021 cores
drwxr-xr-x 1 root root 0 Dec 7 2021 home
drwxr-xr-x 1 root root 0 Jan 1 2022 Library
drwxr-xr-x 1 root root 0 Dec 7 2021 mnt
drwxr-xr-x 1 root root 0 Dec 7 2021 opt
drwxr-xr-x 1 root 80 0 Dec 31 2021 'Previous Content'
drwxr-xr-x 1 root root 0 Dec 7 2021 private
drwxr-xr-x 1 root root 0 Dec 7 2021 sw
drwxr-xr-x 1 root root 0 Dec 7 2021 System
drwxr-xr-x 1 root 80 0 Jan 1 2022 Users
drwxr-xr-x 1 root root 0 Dec 7 2021 usr
drwxr-xr-x 1 root root 0 Jan 16 2022 Volumes [2] details
$ virt-sparsify --verbose --in-place /tmp/lyraphase-runner-macos-monterey-12-1-base/box.img
[...SNIP...]
command: blkid '-c' '/dev/null' '-o' 'value' '-s' 'TYPE' '/dev/sda1'
command: blkid returned 0
command: blkid: stdout:
vfat
command: blkid '-c' '/dev/null' '-o' 'value' '-s' 'TYPE' '/dev/sda2'
command: blkid returned 0
command: blkid: stdout:
apfs
[...SNIP...]
[ 2.6] Trimming /dev/sda1
guestfsd: => mount_options (0x4a) took 0.04 secs
guestfsd: <= fstrim (0x14e) request length 72 bytes
[...SNIP...]
fsync /dev/sda
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: fstrim -v /sysroot/
/sysroot/: 129.5 MiB (135753728 bytes) trimmed
[...SNIP...]
command: mount '-o' 'discard' '/dev/sda2' '/sysroot//'
command: mount returned 32
command: mount: stderr:
mount: /sysroot: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
ocaml_exn: 'mount_options' raised 'Failure' exception
guestfsd: error: mount exited with status 32: mount: /sysroot: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
guestfsd: => mount_options (0x4a) took 0.02 secs
guestfsd: <= pread_device (0x114) request length 68 bytes
[...SNIP...]
[ 2.8] Sparsify in-place operation completed with no errors
$ echo $?
0 Footnotes
|
I'm curious about whether
virt-sysprep
would be possible to use on macOS guest images (e.g. withqcow2
image from QEMU macOS guest).I'm seeing the following:
With verbose + debugging enabled, the main hangup seems to be APFS failed to mount:
Expand for full
virt-sysprep -v -x ...
debug logI haven't tried to install either
apfs-fuse
orlinux-apfs-rw
yet, but was curious if anyone's tried this and if this is a viable path?It looks like at least
linux-apfs-rw
has recently allowed for Read/Write APFS mounts to be enabled by default... maybe it's worth testing?The text was updated successfully, but these errors were encountered: