Last active
May 5, 2017 10:37
-
-
Save yjuba/02f518790efa888e0a901b08d3ca3a69 to your computer and use it in GitHub Desktop.
KVM上にUbuntu 16.04を入れる時のメモ
This file contains 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 -eu | |
set -x | |
virt-install \ | |
--name yjuba-sample000 \ | |
--ram 4096 \ | |
--disk path=/var/lib/libvirt/images/yjuba-sample000.img,size=20 \ | |
--vcpus 2 \ | |
--os-type linux \ | |
--os-variant ubuntuprecise \ # os-variantは最も近いバージョンで指定する | |
--network bridge=br0,model=virtio \ # e1000を使う場合はmodel=e1000を指定する | |
--graphics none \ | |
--console pty,target_type=serial \ | |
--location "http://jp.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/" \ | |
--extra-args "--- console=ttyS0,115200n8 serial ipv6.disable=1" |
起動後にこいつを入れておく
echo 'Acquire::ForceIPv4 "true";' | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4
これで、 apt
が必ずipv4を向く。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--extra-args "--- console=ttyS0,115200n8 serial ipv6.disable=1"
この一行を忘れて毎回探し回るので、ここにメモしておく。