hashicorp / hashicorp/packer-plugin-sdk
Keyboard layout problem with boot_command
- Dominant language
- Go
- Stars
- 42
- Forks
- 62
- Avg merge
- 29m
- Merged PRs (30d)
- 2
Description
I used this build template: **https://github.com/cirruslabs/macos-image-templates/blob/master/templates/vanilla-ventura.pkr.hcl**
Which I modified to have the French language with the AZERTY keyboard.
But something strange happens when it writes "admin" = "qd,in", it doesn't seem to come from the QWERTY either...

In my template I just replaced :
```markdown
# Language
"english",
# Select Your Country and Region
"united states",
```
With this :
```markdown
# Language
"",
# Select Your Country and Region
"",
# Gender
"",
```
Here's the full template:
```go
packer {
required_plugins {
tart = {
version = ">= 1.2.0"
source = "github.com/cirruslabs/tart"
}
}
}
source "tart-cli" "tart" {
# You can find macOS IPSW URLs on various websites like https://ipsw.me/
# and https://www.theiphonewiki.com/wiki/Beta_Firmware/Mac/13.x
from_ipsw = "13.4.ipsw"
vm_name = "ventura"
cpu_count = 4
memory_gb = 8
disk_size_gb = 25
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "120s"
boot_command = [
# hello, hola, bonjour, etc.
"",
# ! Language
"",
# ! Select Your Country and Region
"",
# ! Gender
"",
# Written and Spoken Languages
"",
# Accessibility
"",
# Data & Privacy
"",
# Migration Assistant
"",
# Sign In with Your Apple ID
"",
# Are you sure you want to skip signing in with an Apple ID?
"",
# Terms and Conditions
"",
# I have read and agree to the macOS Software License Agreement
"",
# Create a Computer Account
"adminadminadmin",
# Enable Location Services
"",
# Are you sure you don't want to use Location Services?
"",
# Select Your Time Zone
"paris",
# Analytics
"",
# Screen Time
"",
# Siri
"",
# Choose Your Look
"",
# Enable Voice Over
"v",
# Now that the installation is done, open "System Settings"
"System Settings",
# Navigate to "Sharing"
"fpartage",
# Navigate to "Screen Sharing" and enable it
"",
# Navigate to "Remote Login" and enable it
"",
# Open "Remote Login" details
"",
# Enable "Full Disk Access"
"",
# Click "Done"
"",
# Disable Voice Over
"",
]
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
}
build {
sources = ["source.tart-cli.tart"]
provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"mkdir -p /etc/sudoers.d/; echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
// Enable auto-login
//
// See https://github.com/xfreebird/kcpassword for details.
"echo '00000000: 1ced 3f4a bcbc ba2c caca 4e82' | sudo xxd -r - /etc/kcpassword",
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
// Disable screensaver at login screen
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
// Disable screensaver for admin user
"defaults -currentHost write com.apple.screensaver idleTime 0",
// Prevent the VM from sleeping
"sudo systemsetup -setdisplaysleep Off",
"sudo systemsetup -setsleep Off",
"sudo systemsetup -setcomputersleep Off",
// Launch Safari to populate the defaults
"/Applications/Safari.app/Contents/MacOS/Safari &",
"sleep 30",
"kill -9 %1",
// Enable Safari's remote automation and "Develop" menu
"sudo safaridriver --enable",
"defaults write com.apple.Safari.SandboxBroker ShowDevelopMenu -bool true",
"defaults write com.apple.Safari IncludeDevelopMenu -bool true",
// Disable screen lock
//
// Note that this only works if the user is logged-in,
// i.e. not on login screen.
"sysadminctl -screenLock off -password admin",
]
}
}
```
https://github.com/cirruslabs/packer-plugin-tart/assets/12927290/21241613-b47d-439f-acb2-46b1cd90d437
Contributor guide
Assessment
This issue has not been assessed yet.