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

Automated vanilla image creation via VNC #55

Merged
merged 9 commits into from
Sep 30, 2022

Conversation

edigaryev
Copy link
Contributor

@edigaryev edigaryev commented Sep 19, 2022

@edigaryev edigaryev requested a review from fkorotkov September 19, 2022 11:21
Copy link
Contributor

@fkorotkov fkorotkov left a 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.

vm_name = "monterey-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why so large?

Copy link
Contributor Author

@edigaryev edigaryev Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

fkorotkov added a commit to cirruslabs/packer-plugin-tart that referenced this pull request Sep 20, 2022
fkorotkov added a commit to cirruslabs/packer-plugin-tart that referenced this pull request Sep 20, 2022
}

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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>",
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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>",

Copy link
Contributor

@raven raven Sep 28, 2022

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>",

Copy link
Contributor Author

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.

@edigaryev edigaryev merged commit 3e42cfa into master Sep 30, 2022
@edigaryev edigaryev deleted the automated-vanilla-image-creation branch September 30, 2022 14:12
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

Successfully merging this pull request may close these issues.

3 participants