Commit 0f6e5c35 authored by Erwan BOUSSE's avatar Erwan BOUSSE
Browse files

Initial commit

parents
#!/bin/bash
set -x
set -e
ISO=ubuntu-20.04.1-live-server-amd64.iso
if [ ! -e SHA256SUMS ]; then
wget http://releases.ubuntu.com/20.04/SHA256SUMS
fi
if ! sha256sum -c SHA256SUMS | grep Réussi; then
rm -f $ISO
wget http://releases.ubuntu.com/20.04/$ISO
fi
sudo umount -f -l /mnt || true
sudo mount -r ./$ISO /mnt
cd www
pkill python3 || true
python3 -m http.server 3003 &
cd ..
rm -f image.img
truncate -s 10G image.img
qemu-kvm -no-reboot -m 1024 \
-drive file=image.img,format=raw,cache=none,if=virtio \
-cdrom ./$ISO \
-kernel /mnt/casper/vmlinuz \
-initrd /mnt/casper/initrd \
-append 'autoinstall ds=nocloud-net;s=http://_gateway:3003/'
rm test.vdi
VBoxManage convertfromraw --format vdi image.img test.vdi
# VBoxManage createvm --name [MACHINE NAME] --ostype [Os Type, ex: "Debian_64"] --register --basefolder `pwd`
# VBoxManage storagectl [MACHINE NAME] --name "SATA Controller" --add sata --controller IntelAhci
# VBoxManage storageattach [MACHINE NAME] --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium `pwd`/[MACHINE NAME]/[MACHINE NAME]_DISK.vdi
# VBoxManage modifyvm [MACHINE NAME] --boot1 dvd --boot2 disk --boot3 none --boot4 none
# VBoxManage export [MACHINE NAME] -output yay.ovf
\ No newline at end of file
#cloud-config
autoinstall:
version: 1
identity:
hostname: ubuntu-server
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
username: ubuntu
keyboard:
layout: fr
packages:
- ubuntu-mate-core
locale: fr_FR.UTF-8
late-commands:
- sed -i 's/XSession=ubuntu/XSession=mate' /target/var/lib/AccountsService/users/ubuntu
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment