-
Notifications
You must be signed in to change notification settings - Fork 63
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
Automated vanilla image creation via VNC #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth updating ReadMe as well to highlight there is no need for manual steps anymore.
templates/vanilla-monterey.pkr.hcl
Outdated
vm_name = "monterey-vanilla" | ||
cpu_count = 4 | ||
memory_gb = 8 | ||
disk_size_gb = 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why so large?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why so large?
It's the default disk size that Tart creates: https://github.com/cirruslabs/tart/blob/0229138bd5947410c3c0ef8dfac3cf57e537cf78/Sources/tart/Commands/Create.swift#L19.
If you make this value smaller than the Tart's default, Tart plugin will refuse to work: https://github.com/cirruslabs/packer-plugin-tart/blob/15a18d09f683df3b7dba1de757da7e6c1fbbfecf/builder/tart/step_disk_file_prepare.go#L91-L93.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do something like cirruslabs/packer-plugin-tart#23 to respect disk_size_gb
upon creation.
} | ||
|
||
source "tart-cli" "tart" { | ||
from_ipsw = "https://updates.cdn-apple.com/2022SummerSeed/fullrestores/012-70113/6F1F08B7-9A1B-48A9-93DB-55EE21121C87/UniversalMac_13.0_22A5352e_Restore.ipsw" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment about where to find the URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 57792c0.
# Language | ||
"<wait30s><enter>", | ||
# Select Your Country and Region | ||
"<wait10s>united states<leftShiftOn><tab><leftShiftOff><spacebar>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you're still refining this approach, but in my testing today I was able to reliably navigate through all the setup screens with 2s
waits.
"<wait10s><tab><spacebar>", | ||
# Click "Done" | ||
"<wait10s><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><spacebar>", | ||
# Disable Voice Over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is enabling automatic login no longer required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I have for Ventura System Settings dance:
# --- Remote login with full disk access
# open "System Settings"
"<wait5s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Navigate to "Sharing"
"<wait3s><leftAltOn>f<leftAltOff>sharing<return>",
# Navigate to "Remote Login" and enable it
"<wait3s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Enable "Full Disk Access" for remote login
"<wait3s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
"<wait3s><tab><spacebar><leftShiftOn><tab><tab><leftShiftOff><spacebar>",
# Close System Settings
"<wait3s><leftAltOn>w<leftAltOff>",
# --- Disable screen saver and lock screen
# open "System Settings"
"<wait5s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Navigate to "lock screen"
"<wait3s><leftAltOn>f<leftAltOff>lock screen<return>",
# Select 'Never' for Start Screen Saver when inactive
"<wait3s><tab><spacebar>Never<return>",
# Select 'Never' and enter password for Require password after screen saver begins
"<wait3s><tab><tab><spacebar>Never<return>",
"<wait3s>admin<return>",
"<wait3s><spacebar>",
# Close System Settings
"<wait3s><leftAltOn>w<leftAltOff>",
# --- Automatic login
# open "System Settings"
"<wait5s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Navigate to "Users & Groups"
"<wait3s><leftAltOn>f<leftAltOff>users groups<return>",
# Select 'admin' and enter password for two dialogues for Automatically log in as...
"<wait3s><tab><tab><tab><tab><tab><spacebar>",
"<wait3s>admin<return>",
"<wait3s>admin<return>",
"<wait3s>admin<return>",
# Close System Settings
"<wait3s><leftAltOn>w<leftAltOff>",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding admin to sudoers:
There's probably a better way, as we have already enabled ssh
access, but if doing it via VNC key commands 🤮
# --- Adding admin to sudoers
"<wait5s><leftAltOn><spacebar><leftAltOff>terminal<return>",
"<wait3s>sudo visudo<return>",
"<wait3s>admin<return>",
"<wait3s><leftShiftOn>g<leftShiftOff>o",
"<wait3s>admin<spacebar><leftShiftOn>all<leftShiftOff><spacebar>=<spacebar><leftShiftOn>9all0<spacebar>nopasswd;all<leftShiftOff><esc><leftShiftOn>;<leftShiftOff>wq<return>",
"<wait3s>",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is enabling automatic login no longer required?
It is, it's just still WIP.
There's probably a better way, as we have already enabled ssh access, but if doing it via VNC key commands 🤮
You're right — no need for VNC for this one. Take a look at e9d0196.
Requires cirruslabs/packer-plugin-tart#21.
Needs
0.5.0
release of https://github.com/cirruslabs/packer-plugin-tart.