Created
July 23, 2016 22:28
-
-
Save BrunoVernay/818253fe1dd13d5b20b4d03dfcc04ee2 to your computer and use it in GitHub Desktop.
Packer image Issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lang en_US.UTF-8 | |
keyboard us | |
timezone --utc --nontp Europe/Paris | |
install | |
text | |
skipx | |
reboot | |
url --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch | |
repo --name="Fedora Updates" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch | |
rootpw --plaintext toto | |
user --name=toto --groups=users,wheel --password=toto | |
services --enabled=network,sshd | |
network --bootproto=dhcp | |
firewall --service=ssh | |
selinux --disabled | |
zerombr | |
autopart --type=plain | |
clearpart --all --initlabel | |
bootloader --extlinux --timeout=1 | |
%packages --excludeWeakdeps --ignoremissing | |
@core | |
-dracut | |
kernel-core | |
systemd-udev | |
which | |
# For VirtualBox | |
bzip2 | |
kernel-devel | |
make | |
dkms | |
%end | |
%post --erroronfail | |
# This will make a very long post-installation ... | |
#dnf -y update | |
# parted MBR code doesn't boot extlinux OS install | |
# https://bugzilla.redhat.com/show_bug.cgi?id=1015931 | |
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda | |
echo -e "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
echo -e "%users localhost=/sbin/shutdown -h now" >> /etc/sudoers | |
%end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
sudo systemctl start dkms | |
sudo systemctl enable dkms | |
sudo mount -o loop,ro ~/VBoxGuestAdditions.iso /mnt/ | |
sudo /mnt/VBoxLinuxAdditions.run || : | |
sudo umount /mnt/ | |
rm -f ~/VBoxGuestAdditions.iso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [{ | |
"type": "virtualbox-iso", | |
"guest_os_type": "Fedora_64", | |
"iso_url": "{{user `mirror`}}/releases/24/Server/x86_64/iso/Fedora-Server-netinst-x86_64-24-1.2.iso", | |
"iso_checksum": "071c30520775b3e93bb4c34edab4eab3badc26fbb8473ad3a9458614ba85a4e5", | |
"iso_checksum_type": "sha256", | |
"vm_name": "{{user `name`}}", | |
"name": "{{user `name`}}", | |
"disk_size": "30000", | |
"headless": false, | |
"http_directory": "kickstart", | |
"boot_wait": "5s", | |
"boot_command": [ | |
"<tab> ", | |
"inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/fedora-np.ks.cfg", | |
"<enter>" | |
], | |
"ssh_timeout": "15m", | |
"ssh_username": "toto", | |
"ssh_password": "toto", | |
"shutdown_command": "sudo systemctl poweroff", | |
"vboxmanage": [ | |
["modifyvm", "{{.Name}}", "--memory", "1024"], | |
["modifyvm", "{{.Name}}", "--cpus", "1"], | |
["modifyvm", "{{.Name}}", "--paravirtprovider", "kvm"] | |
], | |
"vboxmanage_post": [ | |
["modifyvm", "{{.Name}}", "--vrde", "off"], | |
["modifyvm", "{{.Name}}", "--nic1", "nat"], | |
["modifyvm", "{{.Name}}", "--nic2", "hostonly"], | |
["modifyvm", "{{.Name}}", "--hostonlyadapter2", "vboxnet0"], | |
["modifyvm", "{{.Name}}", "--nictype1", "virtio"], | |
["modifyvm", "{{.Name}}", "--nictype2", "virtio"], | |
["modifyvm", "{{.Name}}", "--nicpromisc1", "allow-all"], | |
["modifyvm", "{{.Name}}", "--nicpromisc2", "allow-all"], | |
["modifyvm", "{{.Name}}", "--cableconnected1", "on"], | |
["modifyvm", "{{.Name}}", "--cableconnected2", "on"] | |
] | |
}], | |
"provisioners": [{ | |
"type": "shell", | |
"scripts": [ | |
"provisioners/shell/virtualbox.sh" | |
] | |
}], | |
"variables": { | |
"name": "vb-fedora-24-np", | |
"mirror": "http://download.fedoraproject.org/pub/fedora/linux" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment