How-to: An unattended installation of Ubuntu 16.04 on a disk with existing OS
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
-1
down vote
favorite
I had a task of deploying Ubuntu Desktop 16.04 on multiple machines with Windows 10 on them. Of course, to accomplish the task efficiently, I needed to find a way to install automatically.
I asked Google, found various manuals, tried all of them... And that's where I stuck. No matter what I did, I always had the Choose installation type question. As a bonus, I learned that the official documentation is terribly outdated, that there are several types of syntax and all of them don't work at all...
In the end, I saw the light at the end of the tunnel. So as to let others to not have the same struggle as I had, here's the how-to. It's guaranteed to work, given the prerequisites are satisfied.
So:
A question:
How do I make a completely automatic installation of Ubuntu 16.04, if I have a computer or computers with an already installed system (Microsoft Windows, for example)? And how to make it install programms I need after the new system is ready?
16.04 system-installation automation ubiquity
 |Â
show 2 more comments
up vote
-1
down vote
favorite
I had a task of deploying Ubuntu Desktop 16.04 on multiple machines with Windows 10 on them. Of course, to accomplish the task efficiently, I needed to find a way to install automatically.
I asked Google, found various manuals, tried all of them... And that's where I stuck. No matter what I did, I always had the Choose installation type question. As a bonus, I learned that the official documentation is terribly outdated, that there are several types of syntax and all of them don't work at all...
In the end, I saw the light at the end of the tunnel. So as to let others to not have the same struggle as I had, here's the how-to. It's guaranteed to work, given the prerequisites are satisfied.
So:
A question:
How do I make a completely automatic installation of Ubuntu 16.04, if I have a computer or computers with an already installed system (Microsoft Windows, for example)? And how to make it install programms I need after the new system is ready?
16.04 system-installation automation ubiquity
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Like that?
â Mexanizator
Feb 22 at 13:11
 |Â
show 2 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I had a task of deploying Ubuntu Desktop 16.04 on multiple machines with Windows 10 on them. Of course, to accomplish the task efficiently, I needed to find a way to install automatically.
I asked Google, found various manuals, tried all of them... And that's where I stuck. No matter what I did, I always had the Choose installation type question. As a bonus, I learned that the official documentation is terribly outdated, that there are several types of syntax and all of them don't work at all...
In the end, I saw the light at the end of the tunnel. So as to let others to not have the same struggle as I had, here's the how-to. It's guaranteed to work, given the prerequisites are satisfied.
So:
A question:
How do I make a completely automatic installation of Ubuntu 16.04, if I have a computer or computers with an already installed system (Microsoft Windows, for example)? And how to make it install programms I need after the new system is ready?
16.04 system-installation automation ubiquity
I had a task of deploying Ubuntu Desktop 16.04 on multiple machines with Windows 10 on them. Of course, to accomplish the task efficiently, I needed to find a way to install automatically.
I asked Google, found various manuals, tried all of them... And that's where I stuck. No matter what I did, I always had the Choose installation type question. As a bonus, I learned that the official documentation is terribly outdated, that there are several types of syntax and all of them don't work at all...
In the end, I saw the light at the end of the tunnel. So as to let others to not have the same struggle as I had, here's the how-to. It's guaranteed to work, given the prerequisites are satisfied.
So:
A question:
How do I make a completely automatic installation of Ubuntu 16.04, if I have a computer or computers with an already installed system (Microsoft Windows, for example)? And how to make it install programms I need after the new system is ready?
16.04 system-installation automation ubiquity
16.04 system-installation automation ubiquity
edited Feb 22 at 14:54
asked Feb 1 at 10:30
Mexanizator
2618
2618
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Like that?
â Mexanizator
Feb 22 at 13:11
 |Â
show 2 more comments
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Like that?
â Mexanizator
Feb 22 at 13:11
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Like that?
â Mexanizator
Feb 22 at 13:11
@dessert Like that?
â Mexanizator
Feb 22 at 13:11
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Firstly, you need to satisfy the next conditions, otherwise there's no guarantee it'll work, if, say, you have a computer with two disks or will choose MBR mode:
- Ubuntu 16.04;
- The machine has only one disk;
- You don't need the contents on it as all the data is going to be erased;
- UEFI mode is choosed;
- The machine is connected to the Internet by a wire. If not, it would install, but without drivers and updates.
Then:
Download the image:
wget http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
Extract it:
cd folder
xorriso -osirrox on -indev ubuntu-16.04.3-desktop-amd64.iso -extract / custom-isoEdit the config of GRUB, e.g. with
nano
:sudo nano boot/grub/grub.cfg
and add the following:
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set default=0
set timeout=1
menuentry "Install Ubuntu"
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ks.seed auto=true priority=critical debian-installer/locale=ru_Ru keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=Russian countrychooser/shortlist=RU localechooser/supported-locales=ru_RU.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
initrd /casper/initrd.lz
Pay attention to such parameters as locale, layoutcode, languagechooser and etc. and edit correspondingly.
Create the config for the Ubuntu installer, e.g. with
nano
:sudo nano preseed/ks.seed
and add the following:
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-efi/non_efi_system boolean true
d-i debian-installer/locale string ru_RU
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean true
d-i mirror/country string RU
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i passwd/user-fullname string User
d-i passwd/username string user
d-i passwd/user-password-crypted password sOlSUKAdMoT5M
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/success_command
string echo "auto enp0s3" >> /etc/network/interfaces;
echo "iface enp0s3 inet dhcp" >> /etc/network/interfaces;
ifup enp0s3;
apt-get update -y;
in-target apt-get install -y openssh-server;By the way, pay attention to an unsaid feauture of Ubiquity. Just right before launching the success_command section it shutdowns the interfaces (amusing, right?), so to install something from the Internet you have to configure an interface first.
And forgot to mention, the password to User here is 'qwerty123'. I strongly recommend to change it afterwards.
Finally, compile a new image:
sudo mkisofs -D -r -V "UNATTENDED_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/ubuntu/custom-http.iso ~/ubuntu/custom-iso/
And you're good to go.
That's all. I hope that walkthrough would help to someone. Special thanks to Just_a_fake_account and the others from Linux Mint forum, who helped to solve the puzzle.
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Firstly, you need to satisfy the next conditions, otherwise there's no guarantee it'll work, if, say, you have a computer with two disks or will choose MBR mode:
- Ubuntu 16.04;
- The machine has only one disk;
- You don't need the contents on it as all the data is going to be erased;
- UEFI mode is choosed;
- The machine is connected to the Internet by a wire. If not, it would install, but without drivers and updates.
Then:
Download the image:
wget http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
Extract it:
cd folder
xorriso -osirrox on -indev ubuntu-16.04.3-desktop-amd64.iso -extract / custom-isoEdit the config of GRUB, e.g. with
nano
:sudo nano boot/grub/grub.cfg
and add the following:
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set default=0
set timeout=1
menuentry "Install Ubuntu"
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ks.seed auto=true priority=critical debian-installer/locale=ru_Ru keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=Russian countrychooser/shortlist=RU localechooser/supported-locales=ru_RU.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
initrd /casper/initrd.lz
Pay attention to such parameters as locale, layoutcode, languagechooser and etc. and edit correspondingly.
Create the config for the Ubuntu installer, e.g. with
nano
:sudo nano preseed/ks.seed
and add the following:
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-efi/non_efi_system boolean true
d-i debian-installer/locale string ru_RU
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean true
d-i mirror/country string RU
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i passwd/user-fullname string User
d-i passwd/username string user
d-i passwd/user-password-crypted password sOlSUKAdMoT5M
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/success_command
string echo "auto enp0s3" >> /etc/network/interfaces;
echo "iface enp0s3 inet dhcp" >> /etc/network/interfaces;
ifup enp0s3;
apt-get update -y;
in-target apt-get install -y openssh-server;By the way, pay attention to an unsaid feauture of Ubiquity. Just right before launching the success_command section it shutdowns the interfaces (amusing, right?), so to install something from the Internet you have to configure an interface first.
And forgot to mention, the password to User here is 'qwerty123'. I strongly recommend to change it afterwards.
Finally, compile a new image:
sudo mkisofs -D -r -V "UNATTENDED_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/ubuntu/custom-http.iso ~/ubuntu/custom-iso/
And you're good to go.
That's all. I hope that walkthrough would help to someone. Special thanks to Just_a_fake_account and the others from Linux Mint forum, who helped to solve the puzzle.
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
add a comment |Â
up vote
1
down vote
accepted
Firstly, you need to satisfy the next conditions, otherwise there's no guarantee it'll work, if, say, you have a computer with two disks or will choose MBR mode:
- Ubuntu 16.04;
- The machine has only one disk;
- You don't need the contents on it as all the data is going to be erased;
- UEFI mode is choosed;
- The machine is connected to the Internet by a wire. If not, it would install, but without drivers and updates.
Then:
Download the image:
wget http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
Extract it:
cd folder
xorriso -osirrox on -indev ubuntu-16.04.3-desktop-amd64.iso -extract / custom-isoEdit the config of GRUB, e.g. with
nano
:sudo nano boot/grub/grub.cfg
and add the following:
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set default=0
set timeout=1
menuentry "Install Ubuntu"
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ks.seed auto=true priority=critical debian-installer/locale=ru_Ru keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=Russian countrychooser/shortlist=RU localechooser/supported-locales=ru_RU.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
initrd /casper/initrd.lz
Pay attention to such parameters as locale, layoutcode, languagechooser and etc. and edit correspondingly.
Create the config for the Ubuntu installer, e.g. with
nano
:sudo nano preseed/ks.seed
and add the following:
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-efi/non_efi_system boolean true
d-i debian-installer/locale string ru_RU
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean true
d-i mirror/country string RU
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i passwd/user-fullname string User
d-i passwd/username string user
d-i passwd/user-password-crypted password sOlSUKAdMoT5M
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/success_command
string echo "auto enp0s3" >> /etc/network/interfaces;
echo "iface enp0s3 inet dhcp" >> /etc/network/interfaces;
ifup enp0s3;
apt-get update -y;
in-target apt-get install -y openssh-server;By the way, pay attention to an unsaid feauture of Ubiquity. Just right before launching the success_command section it shutdowns the interfaces (amusing, right?), so to install something from the Internet you have to configure an interface first.
And forgot to mention, the password to User here is 'qwerty123'. I strongly recommend to change it afterwards.
Finally, compile a new image:
sudo mkisofs -D -r -V "UNATTENDED_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/ubuntu/custom-http.iso ~/ubuntu/custom-iso/
And you're good to go.
That's all. I hope that walkthrough would help to someone. Special thanks to Just_a_fake_account and the others from Linux Mint forum, who helped to solve the puzzle.
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Firstly, you need to satisfy the next conditions, otherwise there's no guarantee it'll work, if, say, you have a computer with two disks or will choose MBR mode:
- Ubuntu 16.04;
- The machine has only one disk;
- You don't need the contents on it as all the data is going to be erased;
- UEFI mode is choosed;
- The machine is connected to the Internet by a wire. If not, it would install, but without drivers and updates.
Then:
Download the image:
wget http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
Extract it:
cd folder
xorriso -osirrox on -indev ubuntu-16.04.3-desktop-amd64.iso -extract / custom-isoEdit the config of GRUB, e.g. with
nano
:sudo nano boot/grub/grub.cfg
and add the following:
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set default=0
set timeout=1
menuentry "Install Ubuntu"
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ks.seed auto=true priority=critical debian-installer/locale=ru_Ru keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=Russian countrychooser/shortlist=RU localechooser/supported-locales=ru_RU.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
initrd /casper/initrd.lz
Pay attention to such parameters as locale, layoutcode, languagechooser and etc. and edit correspondingly.
Create the config for the Ubuntu installer, e.g. with
nano
:sudo nano preseed/ks.seed
and add the following:
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-efi/non_efi_system boolean true
d-i debian-installer/locale string ru_RU
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean true
d-i mirror/country string RU
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i passwd/user-fullname string User
d-i passwd/username string user
d-i passwd/user-password-crypted password sOlSUKAdMoT5M
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/success_command
string echo "auto enp0s3" >> /etc/network/interfaces;
echo "iface enp0s3 inet dhcp" >> /etc/network/interfaces;
ifup enp0s3;
apt-get update -y;
in-target apt-get install -y openssh-server;By the way, pay attention to an unsaid feauture of Ubiquity. Just right before launching the success_command section it shutdowns the interfaces (amusing, right?), so to install something from the Internet you have to configure an interface first.
And forgot to mention, the password to User here is 'qwerty123'. I strongly recommend to change it afterwards.
Finally, compile a new image:
sudo mkisofs -D -r -V "UNATTENDED_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/ubuntu/custom-http.iso ~/ubuntu/custom-iso/
And you're good to go.
That's all. I hope that walkthrough would help to someone. Special thanks to Just_a_fake_account and the others from Linux Mint forum, who helped to solve the puzzle.
Firstly, you need to satisfy the next conditions, otherwise there's no guarantee it'll work, if, say, you have a computer with two disks or will choose MBR mode:
- Ubuntu 16.04;
- The machine has only one disk;
- You don't need the contents on it as all the data is going to be erased;
- UEFI mode is choosed;
- The machine is connected to the Internet by a wire. If not, it would install, but without drivers and updates.
Then:
Download the image:
wget http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso
Extract it:
cd folder
xorriso -osirrox on -indev ubuntu-16.04.3-desktop-amd64.iso -extract / custom-isoEdit the config of GRUB, e.g. with
nano
:sudo nano boot/grub/grub.cfg
and add the following:
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set default=0
set timeout=1
menuentry "Install Ubuntu"
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/preseed/ks.seed auto=true priority=critical debian-installer/locale=ru_Ru keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=Russian countrychooser/shortlist=RU localechooser/supported-locales=ru_RU.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
initrd /casper/initrd.lz
Pay attention to such parameters as locale, layoutcode, languagechooser and etc. and edit correspondingly.
Create the config for the Ubuntu installer, e.g. with
nano
:sudo nano preseed/ks.seed
and add the following:
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-efi/non_efi_system boolean true
d-i debian-installer/locale string ru_RU
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean true
d-i mirror/country string RU
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i passwd/user-fullname string User
d-i passwd/username string user
d-i passwd/user-password-crypted password sOlSUKAdMoT5M
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/success_command
string echo "auto enp0s3" >> /etc/network/interfaces;
echo "iface enp0s3 inet dhcp" >> /etc/network/interfaces;
ifup enp0s3;
apt-get update -y;
in-target apt-get install -y openssh-server;By the way, pay attention to an unsaid feauture of Ubiquity. Just right before launching the success_command section it shutdowns the interfaces (amusing, right?), so to install something from the Internet you have to configure an interface first.
And forgot to mention, the password to User here is 'qwerty123'. I strongly recommend to change it afterwards.
Finally, compile a new image:
sudo mkisofs -D -r -V "UNATTENDED_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/ubuntu/custom-http.iso ~/ubuntu/custom-iso/
And you're good to go.
That's all. I hope that walkthrough would help to someone. Special thanks to Just_a_fake_account and the others from Linux Mint forum, who helped to solve the puzzle.
edited Feb 22 at 18:27
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
dessert
20k55795
20k55795
answered Feb 22 at 14:54
Mexanizator
2618
2618
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
add a comment |Â
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
But I've already done that. See, how indented the text in the answer is?
â Mexanizator
Feb 22 at 15:19
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
@dessert Thanks to you guys too! :) By the way, isn't the code area supposed to be somehow outlined comparing to the text? You know, like a text when it's quoted.
â Mexanizator
Feb 22 at 15:39
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
You may want to format the code in Step 5 as a one long string rather than three lines. This makes it easier to copy and paste.
â user68186
Feb 22 at 18:02
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002043%2fhow-to-an-unattended-installation-of-ubuntu-16-04-on-a-disk-with-existing-os%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Maybe helpful: Ubuntu 16.04 Unattended-Install for UEFI using preseed · github Other useful resources are Performing an automated Ubuntu install using preseeding and https://help.ubuntu.com.
â dessert
Feb 7 at 10:34
Thanks, but all of them are for an installing to a disk without OS.
â Mexanizator
Feb 7 at 12:10
I don't understand, partitioning is treated in the help.ubuntu.com example-preseed.txt as well as in the github one, what difference does it make and what else do you need? Please edit and clarify your question!
â dessert
Feb 7 at 12:39
@dessert Hello, I remade the post. What do I do to make it available to the others?
â Mexanizator
Feb 22 at 12:40
@dessert Like that?
â Mexanizator
Feb 22 at 13:11