LoginSignup
9
10

More than 5 years have passed since last update.

PreseedによるUbuntuの自動インストールできた。

Last updated at Posted at 2013-12-19

準備

  • wnoguchiさんのpreseed.cfgprescript.shをローカルにコピー。
  • ローカルでWebサーバーを起動$ php -S 0.0.0.0:4000してファイルを取得できるようにしましょう。
    • httpsからはファイルを取得できない様子。

インストール開始

インストーラの画面でF6キーを押してbootオプション入力欄を開く。
url=http://192.168.11.122:4000/preseed.cfg
と追記しEnter。

言語とホスト名を聞いてきますがそれ以外は聞いてこなくなりました。
インストールが終わったら自動で再起動します。

  • HDDのパーティショニングは手動でやってもいいかも。
自分の変更点
--- preseed.cfg.org 2013-12-19 10:59:17.000000000 +0900
+++ preseed.cfg 2013-12-19 10:45:49.000000000 +0900
@@ -31,30 +31,31 @@
 # - http://debian.2.n7.nabble.com/Bug-688273-Preseed-netcfg-use-autoconfig-and-netcfg-disable-dhcp-doesn-t-work-td1910023.html
 #
 # 以下の2項目を設定しないと静的IPとして処理されないので重要
-d-i netcfg/use_autoconfig boolean false 
-d-i netcfg/disable_autoconfig boolean true 
- 
-d-i netcfg/choose_interface select eth0 
-d-i netcfg/disable_dhcp boolean true 
-d-i netcfg/get_nameservers string 8.8.8.8 
-d-i netcfg/get_ipaddress string 192.168.1.201 
-d-i netcfg/get_netmask string 255.255.255.0 
-d-i netcfg/get_gateway string 192.168.1.1 
-d-i netcfg/confirm_static boolean true 
-d-i netcfg/get_hostname string stack01 
-d-i netcfg/get_domain string pg1x.com 
-d-i netcfg/wireless_wep string 
+#d-i netcfg/use_autoconfig boolean false 
+#d-i netcfg/disable_autoconfig boolean true 
+
+#d-i netcfg/choose_interface select eth0 
+#d-i netcfg/disable_dhcp boolean true 
+#d-i netcfg/get_nameservers string 8.8.8.8 
+#d-i netcfg/get_ipaddress string 192.168.1.201 
+#d-i netcfg/get_netmask string 255.255.255.0 
+#d-i netcfg/get_gateway string 192.168.1.1 
+#d-i netcfg/confirm_static boolean true 
+#d-i netcfg/get_hostname string stack01 
+#d-i netcfg/get_domain string pg1x.com 
+#d-i netcfg/wireless_wep string 
 #-------------------------------------------------------------------------------------------
 # DHCPのとき
 #-------------------------------------------------------------------------------------------
-#d-i netcfg/choose_interface select eth0 
-#d-i netcfg/disable_autoconfig boolean false
-#d-i netcfg/get_hostname string openstack 
-#d-i netcfg/get_domain string sv.pg1x.com 
-#d-i netcfg/wireless_wep string 
+d-i netcfg/choose_interface select eth0 
+d-i netcfg/disable_autoconfig boolean false
+d-i netcfg/get_hostname string openstack 
+d-i netcfg/get_domain string sv.pg1x.com 
+d-i netcfg/wireless_wep string 

 # いったんリセット
-d-i preseed/run string http://gist.github.com/wnoguchi/6578034/raw/prescript.sh
+#d-i preseed/run string http://gist.github.com/wnoguchi/6578034/raw/prescript.sh
+d-i preseed/run string /prescript.sh
 #===========================================================================================
 # BOOT SEQUENCE CONFIGURATIONS END
 #===========================================================================================
@@ -109,14 +110,14 @@
 d-i base-installer/install-recommends boolean true 
 d-i base-installer/kernel/image string linux-generic 

-d-i passwd/root-login boolean true 
-d-i passwd/make-user boolean false 
-d-i passwd/root-password password password 
-d-i passwd/root-password-again password password 
-d-i passwd/user-fullname string testuser 
-d-i passwd/username string testuser 
-d-i passwd/user-password password insecure 
-d-i passwd/user-password-again password insecure 
+d-i passwd/root-login boolean false 
+d-i passwd/make-user boolean true 
+#d-i passwd/root-password password vagrant 
+#d-i passwd/root-password-again password vagrant
+d-i passwd/user-fullname string vagrant 
+d-i passwd/username string vagrant 
+d-i passwd/user-password password vagrant
+d-i passwd/user-password-again password vagrant
 d-i user-setup/allow-password-weak boolean true 
 d-i user-setup/encrypt-home boolean false 

インストール済み環境からpreseed.cfgを生成

sudo apt-get install debconf-utils
生成
debconf-get-selections --installer > preseed.cfg
debconf-get-selections >> preseed.cfg
syntax check
$ debconf-set-selections -c preseed.cfg

ESC
auto url=http://host/path/to/preseed.cfg

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10