Skip to content

Commit

Permalink
Modernize VirtualBox configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jlduran committed Sep 4, 2023
1 parent d952e95 commit 9d7cc6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions http/installerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ fi
if [ "$FILESYSTEM" = 'ufs' ]; then
PARTITIONS="$GEOM"
else
export ZFSBOOT_BOOT_TYPE="UEFI"
export ZFSBOOT_DISKS="$GEOM"
export ZFSBOOT_PARTITION_SCHEME="GPT"
if [ "$ZFS_COMPRESSION" = 'zstd' ]; then
export ZFSBOOT_POOL_CREATE_OPTIONS="-O compress=zstd -O atime=off"
fi
Expand Down
12 changes: 9 additions & 3 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,29 @@ source "virtualbox-iso" "freebsd" {
boot_command = ["<esc><wait>", "boot -s<enter>", "<wait15s>", "/bin/sh<enter><wait>", "mdmfs -s 100m md /tmp<enter><wait>", "dhclient -l /tmp/dhclient.lease.vtnet0 vtnet0<enter><wait5>", "fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/installerconfig<enter><wait5>", "FILESYSTEM=${var.filesystem}<enter>", "export FILESYSTEM<enter>", "ZFS_COMPRESSION=${var.zfs_compression}<enter>", "export ZFS_COMPRESSION<enter>", "RC_CONF_FILE=${var.rc_conf_file}<enter>", "export RC_CONF_FILE<enter>", "bsdinstall script /tmp/installerconfig<enter>"]
boot_wait = "10s"
cpus = "${var.cpus}"
chipset = "ich9"
disk_size = "${var.disk_size}"
export_opts = ["--manifest", "--vsys", "0", "--product", "FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}", "--producturl", "https://www.freebsd.org", "--description", "FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.", "--version", "${var.revision}-${var.branch}"]
firmware = "efi"
gfx_controller = "vmsvga"
gfx_vram_size = 5
guest_additions_mode = "disable"
guest_os_type = "${var.guest_os_type}"
hard_drive_interface = "sata"
hard_drive_interface = "virtio"
headless = true
http_directory = "http"
iso_checksum = "file:${var.mirror}/${var.directory}/ISO-IMAGES/${var.revision}/CHECKSUM.SHA256-FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}"
iso_interface = "sata"
iso_interface = "virtio"
iso_urls = ["iso/FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}-disc1.iso", "${var.mirror}/${var.directory}/ISO-IMAGES/${var.revision}/FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}-disc1.iso"]
memory = "${var.memory}"
nested_virt = true
nic_type = "virtio"
shutdown_command = "poweroff"
ssh_password = "vagrant"
ssh_port = 22
ssh_timeout = "1000s"
ssh_username = "root"
vboxmanage = [["modifyvm", "{{ .Name }}", "--graphicscontroller", "vmsvga", "--nictype1", "virtio"], ["storagectl", "{{ .Name }}", "--name", "IDE Controller", "--remove"]]
vboxmanage = [["modifyvm", "{{ .Name }}", "--mouse", "usbmultitouch", "--pae", "off"], ["storagectl", "{{ .Name }}", "--name", "IDE Controller", "--remove"]]
virtualbox_version_file = ".vbox_version"
vm_name = "box"
}
Expand Down

0 comments on commit 9d7cc6e

Please sign in to comment.