2

I want to create Ubuntu 14.04 VM with virt-install and preseed configuration. I have provided:

d-i netcfg/enable boolean true
d-i netcfg/choose_interface select auto
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_ipaddress string 192.168.1.210
d-i netcfg/get_netmask string /24
d-i netcfg/get_gateway string 192.168.1.254
d-i netcfg/get_hostname string ubuntu.com
d-i netcfg/get_nameservers string 8.8.8.8
d-i netcfg/confirm_static boolean true

But anyway I have another ip in guest VM. Need your help

Vladimir Kovalchuk
  • 179
  • 1
  • 2
  • 7

1 Answers1

2

To disable dhcp you need to have disable_autoconfig and not disable_dhcp:

d-i netcfg/disable_autoconfig boolean true

The netmask declartion looks also wrong. Try this instead:

d-i netcfg/get_netmask string 255.255.255.0

Check here for complete ref: B.4. Contents of the preconfiguration file (for trusty)

# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
#d-i netcfg/disable_autoconfig boolean true

# Static network configuration.
#d-i netcfg/get_nameservers string 192.168.1.1
#d-i netcfg/get_ipaddress string 192.168.1.42
#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
Diamond
  • 9,001
  • 3
  • 24
  • 38
  • All exactly the same. Ip was assigned from DHCP – Vladimir Kovalchuk Mar 17 '16 at 15:33
  • What do you mean? doesn't work? Then add this too and see `d-i netcfg/dhcp_options select Configure network manually` – Diamond Mar 17 '16 at 15:43
  • Yes, this doesn't work, my config `d-i netcfg/enable boolean true` `d-i netcfg/choose_interface select eth0` ` d-i netcfg/disable_autoconfig boolean true` `d-i netcfg/dhcp_failed note` `d-i netcfg/dhcp_options select Configure network manually` `d-i netcfg/get_ipaddress string 192.168.1.222` `d-i netcfg/get_netmask string /24` `d-i netcfg/get_gateway string 192.168.1.254` `d-i netcfg/get_hostname string ubuntu3.com` `d-i netcfg/get_nameservers string 8.8.8.8` `d-i netcfg/confirm_static boolean true` – Vladimir Kovalchuk Mar 17 '16 at 16:20
  • @VladimirKovalchuk, change two more lines and see: `d-i netcfg/get_netmask string 255.255.255.0` and `d-i netcfg/get_hostname string ubuntu` (you can't use . in hostname) – Diamond Mar 18 '16 at 14:24