Skip to content

Instantly share code, notes, and snippets.

@yjuba
Last active May 5, 2017 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yjuba/02f518790efa888e0a901b08d3ca3a69 to your computer and use it in GitHub Desktop.
Save yjuba/02f518790efa888e0a901b08d3ca3a69 to your computer and use it in GitHub Desktop.
KVM上にUbuntu 16.04を入れる時のメモ
#!/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"
@yjuba
Copy link
Author

yjuba commented May 3, 2017

--extra-args "--- console=ttyS0,115200n8 serial ipv6.disable=1"
この一行を忘れて毎回探し回るので、ここにメモしておく。

@yjuba
Copy link
Author

yjuba commented May 3, 2017

起動後にこいつを入れておく
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