netson / ubuntu-unattended Goto Github PK
View Code? Open in Web Editor NEWScript to create unattended Ubuntu ISO
License: MIT License
Script to create unattended Ubuntu ISO
License: MIT License
Hi there, any plans to support 20.04+?
Thank you.
It only checks the $tmp folder. When the iso is download, it keeps it in the user's home directory.
An addition checksum logic should be implemented to make sure that the iso is correct.
Hi,
Any plans to add this to the next update?
Cheers
In #15, wget got a 404 instead of the iso, because Ubuntu had bumped 14.04.3 to 14.04.4. This will happen every few months as they release maintenance updates, requiring this script to make a code change to download the latest version.
It would be nice to figure out a method to automatically determine the latest version of each series. The naive way would be to try a version, and while it gets a 404, increment the revision number and try again.
This isn't ideal, but I don't know if Ubuntu has a way to programmatically get a version number. I've asked on stackexchange so that might help.
there are error messages when running the script:
finished remastering your ubuntu iso file
the new file is located at: /root/ubuntu-23.10-server-amd64-unattended.iso
also the created stick doesn't work as suspected, it stops at "select your language" (and all the other questions) and waits for input.
Hi there,
I'm looking for an easier method to install Ubuntu 16 on computers in my office. This project looks like the perfect soloution, but your description says that it only supports Ubuntu Server "out of the box".
So the question is if it's possible to create an unattended Ubuntu desktop installation?
Been testing the script for the pre-seeding of an Ubuntu 18.04 instance and it doesn't seem to work.
As some one has an inside about this?
This is not really an issue but more of a question, and possibly a suggestion...
First of all, this is an awesome script; it's exactly what I am looking for.
Is there a way to update the netson.seed and recreate the unattended .iso with the updated seed file?
The reason I ask is because I want to be able to add services (SSH server, web server, etc.) to my unattended .iso file and the only way I would do that is by updating the seed file.
Perhaps you can add an option to the create-unattended-iso.sh script to ask what services you would like to install during the the unattend install? Or, perhaps add the option to the start.sh script to ask what software/services to install? Also, adding the option in the start script to configure network could be an good option also as a DHCP server is not often an option in some networks.
I have a network configuration script I have created to setup a static IP if you are interested in having.
Bionic address shouldn't be:
http://cdimage.ubuntu.com/releases/release/ubuntu-server-amd64.iso
It should be:
http://cdimage.ubuntu.com/releases/18.04.3/release/ubuntu-18.04.3-server-amd64.iso
First of all thanks for this, I love it.
Is there a way to first that start script, or any other script, to run on that first boot? Ideally the hostname and other tools to be ready to go after X or so minutes, then I know the device is up and has all that I need. For example disable screen blanking and other small configurations.
I've been using a disk image to do my cloning, but I find that is not ideal as I make changes over time, and then I need to do the disk image again and a few steps in between.
Suggestions?
Hi Rinck,
I encountered the same code, at least in its initial form, released in the same year but under the GPL3 license - https://github.com/hvanderlaan/ubuntu-unattended
The only trace to your work is a comment in the script "# copy the netson seed file to the iso", while the seed file is named differently. Wondering what is the netson seed, I found your repository. It looks like your repository was the origin of the hvanderlaan repository but I do not see any credits in his repository... Can you please comment?
Thanks,
Michael
I get the following error when installing the unattended version:
I just used the provided bash script and did not changed one thing. I used the image in VMware ESXI. The 16.04 version. I hope this helps :)
Update:
This problem is present in version 16.04 and 16.04.1, the 14.04 version does work
This may be the wrong way to go about it, but is there any option that could create a luks encryption unattended installer?
I love this as it works well, and I can boot a VM from ISO fully unattended, but when I write the ISO to USB, it boots the GNU Brub menu without the preseed option and only the default Linux install menu. I am using windows and Rufus to write the ISO to USB
🥳🥳🥳
Hi there, over in #61 I had asked about support for 20.04 + and it was indicated that the script should support this already. SO it seems like I may be running into an issue.
When I ran it, 18.04.5
was the latest release in the results. Any suggestions?
Am I doing something wrong?
Thank you.
Ubuntu is not downloaded due to an illegal sed option. See script output:
+---------------------------------------------------+
| UNATTENDED UBUNTU ISO MAKER |
+---------------------------------------------------+
create-unattended-iso.sh: line 63: lsb_release: command not found
which ubuntu edition would you like to remaster:
[1] Ubuntu 12.04.5 LTS Server amd64 - Precise Pangolin
[2] Ubuntu 14.04.5 LTS Server amd64 - Trusty Tahr
[3] Ubuntu 16.04.6 LTS Server amd64 - Xenial Xerus
[4] Ubuntu 18.04.2 LTS Server amd64 - Bionic Beaver
please enter your preference: [1|2|3|4]: 4
please enter your preferred timezone: Europe/London
please enter your preferred username: user
please enter your preferred password:
confirm your preferred password:
Make ISO bootable via USB: yes
downloading ubuntu-18.04.2-server-amd64.iso: sed: illegal option -- u
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Ok, I figured this was what I needed to automatically get me up and running. The problem was, the image built just fine (the download links all fail of course, ubuntu has moved folder locations) but it made the unattended iso no problems. it boots the unattended iso no problems.
why on earth is an UNATTENDED iso booting to a menu where you are required to select from the options:
Autoinstall NETSON Ubuntu Server
Install Ubuntu Server
Multiple Server install with MAAS
Check disc for defects
Test Memory
Boot from first hard disk
Rescue a broken disc
and of course it just hangs there. It does nothing. How is this unattended? if anything, this would be ATTENDED?
..
Hey guys,
I tried to generate a new iso file with ur create-unattended-iso.sh script.
It doesnt even get to show the available versions of ubuntu, it should show 20.04 as the newest version.
Has anyone tested/used it recently? Have u to modify anything before starting the script?
Thanks in advance
Hi,
It works great, but when I try to use it with UEFI all the automated stuff doesn't work.
Is there any way enable UEFI and make it unattended?
for version in $(wget -qO - http://cdimage.ubuntu.com/releases/ | grep -w DIR | grep -oP href=\"[0-9].* | cut -d'"' -f2 | tr -d '/'); do
to
for version in $(wget -qO - http://cdimage.ubuntu.com/releases/ | grep -oP href=\"[0-9].* | cut -d'"' -f2 | tr -d '/'); do
I'm trying to use your script to create an ISO that would automatically run a script upon installation (pick up the hostname from ESXi after SaltStack creates the VM and alter /etc/hosts with the new hostname).
I've been able to successfully move the script from the /preseed directory of the ISO into /root on the target system, but so far I haven't been able to have the script execute as part of the installation process.
(I even tried adding "chroot /target /root/ncc-hostname.sh" on the end of late_command, but that failed.)
Would that be at all possible with Ubuntu 18.04, or would that have to be done as part of the first boot?
I've attached my patches to your script and seed file as well as the custom script I want to execute as part of the installation process.
Thanks in advance!
Hello.
Awesome script, its working perfect but on hyper-v only on Gen 1
Scenario
Gen 2 - disabled secure boot, boot from CD -> cannot boot and it will try to boot from network (defaul ubuntu doesn't have problem)
I can't get auto install ubuntu when i boot ubuntu unattend that created by script.
it's pulling the live iso and doesn't inject the auto install into txt.cfg i tried modifying the install script but couldn't get it to work correctly
the set command at 252:
sed -i "/label install/ilabel autoinstall\n\
is not running since there no install in the file:
default live
label live
menu label ^Install Ubuntu Server
kernel /casper/vmlinuz
append initrd=/casper/initrd quiet ---
label live-nomodeset
menu label ^Install Ubuntu Server (safe graphics)
kernel /casper/vmlinuz
append initrd=/casper/initrd quiet nomodeset ---
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80
I ran this script to set up an iso, and it failed, showing the following output (password censored). On investigating, it was not able to download the 14.04 image. It didn't show a progress meter, just said DONE, and didn't handle the wget error at all or check for a missing file.
I would like for this script to check for the existence of the downloaded file after the download and exit with an error message if it doesn't exist.
I was running this on a stock ubuntu 14.04 in a vagrant/virtualbox, as user vagrant using sudo. Once I figured out it wasn't downloading, I tried to make an ubuntu 16 iso and that started the download and showed a progress indicator.
Output from program when it failed to download:
+---------------------------------------------------+
| UNATTENDED UBUNTU ISO MAKER |
+---------------------------------------------------+
which ubuntu edition would you like to remaster:
[1] Ubuntu 12.04.4 LTS Server amd64 - Precise Pangolin
[2] Ubuntu 14.04.3 LTS Server amd64 - Trusty Tahr
[3] Ubuntu 16.04 LTS Server amd64 - Xenial Xerus
please enter your preference: [1|2|3]: 2
please enter your preferred timezone: Etc/UTC
please enter your preferred username: ubuntu
please enter your preferred password:
confirm your preferred password:
Make ISO bootable via USB: yes
downloading ubuntu-14.04.3-server-amd64.iso: DONE
-h downloading netson.seed:
DONE
installing required packages
remastering your iso file
./create-unattended-iso.sh: line 161: /tmp/iso_new/isolinux/lang: No such file or directory
cp: cannot create regular file ‘/tmp/iso_new/preseed/netson.seed’: No such file or directory
./create-unattended-iso.sh: line 173: /tmp/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /tmp/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /tmp/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /tmp/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /tmp/iso_new/preseed/netson.seed: No such file or directory
md5sum: /tmp/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /tmp/iso_new/isolinux/txt.cfg: No such file or directory
creating the remastered iso
isohybrid: could not open file `/tmp/ubuntu-14.04.3-server-amd64-unattended.iso': No such file or directory
umount: /tmp/iso_org: not mounted
-----
finished remastering your ubuntu iso file
the new file is located at: /tmp/ubuntu-14.04.3-server-amd64-unattended.iso
your username is: ubuntu
your password is: ????????
your hostname is: ubuntu
your timezone is: Etc/UTC
vagrant@mytestvm:~$ cd /tmp/
vagrant@mytestvm:/tmp$ ls
netson.seed
this is because on my machine, the softlink is as follows:
lrwxrwxrwx. 1 root root 38 Jan 14 09:01 /etc/localtime -> ../usr/share/zoneinfo/America/New_York
so this causes the default answer in the prompt to be as follows:
please enter your preferred timezone: ..America/New_York
Line 67 needs to be updated to...
ubuntu-12.04.5-server-amd64.iso
Line 71 needs to be updated to...
ubuntu-14.04.2-server-amd64.iso
All seems to work but it reboots when starting start.sh and after the reboot there are no iso-files.
Am I missing something but where is the iso-file located?
Before starting start.sh I can see Ubuntu16-iso
Add support for Ubuntu LTS Unattended installs including Mini images.
https://help.ubuntu.com/community/Installation/MinimalCD
Focal (20.04) isn't listed there yet, however can be found here: http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/mini.iso
Cheers.
Any idea why when I use the script to create an installation and use the preseed, I get this load screen? https://i.cyanlab.io/YmMwNWNk.png
Also as a side note, any idea why I get a yellow bash when using the preseed script?
Got these errors while trying to create a ubuntu 22.04.4 unattended iso. Doesn't create the iso. Maybe ubuntu 22 is not supported?
edit: It probably IS because it's not supported. I created an unattended iso from ubuntu 18.04. I'll just install that and do a dist-upgrade.
edit2: I tried installing on VM and it does ask questions (select language, keyboard distritbution, etc.) so it's not really unattended... Am I doing anything wrong? Just executed the thing, selected ubuntu, answered the questions and it created this unattended iso...
create-unattended-iso.sh: line 217: /root/iso_new/isolinux/lang: No such file or directory
sed: can't read /root/iso_new/isolinux/isolinux.cfg: No such file or directory
cp: cannot create regular file '/root/iso_new/preseed/netson.seed': No such file or directory
create-unattended-iso.sh: line 235: /root/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /root/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /root/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /root/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /root/iso_new/preseed/netson.seed: No such file or directory
md5sum: /root/iso_new/preseed/netson.seed: No such file or directory
sed: can't read /root/iso_new/isolinux/txt.cfg: No such file or directory
creating the remastered iso
create-unattended-iso.sh: line 268: isohybrid: command not found
-----
finished remastering your ubuntu iso file```
I tried to install the unattended iso file created using the script in a KVM virtual machine.
Everything goes fine during the install, but the machine hangs on the first boot after install. The same problem doesn't happen when I install the standard server iso file. Also, the same unattended iso file works fine with VirtualBox. I first thought the error might be due to some intel_rapl message at the beginning, but it's not.
Hi @netson
Firstly, thanks for this tool, really useful!
I've found that when I boot from the ISO it's sitting on the Ubuntu splash screen waiting for me to select an installation option (Run AutoInstall, Boot from X, etc)
I have splash set to False (like in your example preseed) too as per the below;
d-i debian-installer/splash boolean false
Ideally when the VM comes online I'd like it to go straight into the Auto Installation from the ISO.
Any thoughts?
This is running Ubuntu 14.04.
Cheers!
+---------------------------------------------------+
| UNATTENDED UBUNTU ISO MAKER |
+---------------------------------------------------+
which ubuntu edition would you like to remaster:
[1] Ubuntu href="precise/" LTS Server amd64 - Precise Pangolin
[2] Ubuntu href="trusty/" LTS Server amd64 - Trusty Tahr
[3] Ubuntu href="xenial/" LTS Server amd64 - Xenial Xerus
[4] Ubuntu href="bionic/" LTS Server amd64 - Bionic Beaver
please enter your preference: [1|2|3|4]: 4
please enter your preferred timezone: Etc/UTC
please enter your preferred username: whittinghamj
please enter your preferred password:
confirm your preferred password:
Make ISO bootable via USB: yes
downloading ubuntu-href="bionic/"-server-amd64.iso: 11:52: DONE
Error: Failed to download ISO: http://cdimage.ubuntu.com/releases/href="bionic/"/release/ubuntu-href="bionic/"-server-amd64.iso
This file may have moved or may no longer exist.
You can download it manually and move it to /root/ubuntu-href="bionic/"-server-amd64.iso
Then run this script again.
Any ideas?
Hi, I’m quite new to this so sorry if it’s already been asked.
I’ve got a headless server i with to install Ubuntu on but it needs to be completely automated from boot to login. This means I need to be able to give it a static IP and include ssh packages to let me login to it when it’s finished. From the readme it seems like I need a screen and kb attached to be able to run start.sh, which defeats the purpose of creating the automated install in the first place. Is this the case, or will this script do what is required for me?
Thanks!
line 105 needs to be changed to...
https://raw.githubusercontent.com/netson/ubuntu-unattended/raw/master/$seed_file
Can this be adjusted to work with Ubuntu Desktop as well? I have to do some automated deployments, and making the creation, and recreation of the iso so easy would be awesome!.
Thanks
the exclude list (line 79) should be extended with |live
at line 91 the exclude list should be added
line 91: wget -qO - ${URL} | grep server | grep amd64 | egrep -v ${EXLCUDE_LIST} >/dev/null
Hey,
thanks for the great project!
I would love to be able to add files from my local maschine into the installed linux. It is not a problem to copy the files to the image of course, but how do I get a file from the image copied into the users home folder during the install process?
Thanks a lot!
Tom
Using this script to create an unattended install for a headless Atom NIC box.
Xenial 16.04 server base. Non-automated - waits for the Ubuntu Language Selection screen at grub/isoboot before even getting to Debian installer.
Would like to install headless latest ubuntu 18.04 meaning that 100% unattended without monitor, keyboard and mouse. How should I modified netson.seed? With SSH install and apt etc? Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.