Score:2

Removing Install Screen when booting from Live USB with persistence on 20.04 Ubuntu Server

za flag

I understand this question is extremely similar to this, however the solutions in that question do not apply to current methods of controlling Grub when booting a USB. My initial grub screen is controlled by grub.cfg, not syslinux.txt or isolinux.txt.

To start off with, I have successfully created a persistent USB. I can use ctrl-alt-f3 to drop into shell and do what I need to do (which is compile and run a program). However I am unable to edit grub.cfg in such a way that I can either boot straight into terminal, or bypass the Install screen entirely. Having to drop into the shell display is annoying and not the way I want this to work.

The following default menuentry in my grub.cfg is the issue. I need this to be persistent, and text based. When I add both text and persistent flags, nothing changes; I still get thrown into the Ubuntu Server install screen.

menuentry "Install Ubuntu Server" {
    set gfxpayload=keep
    linux   /casper/vmlinuz   quiet  ---
    initrd  /casper/initrd
}

What do I need to change to make this go straight into a terminal?

This question also gets close, but unfortunately doesn't help me either.

This question doesn't help me either as I am using the stated version of mkusb-plug which apparently removed Try/Install. Doesn't stop it booting into Ubuntu Server's setup screen!

C.S.Cameron avatar
cn flag
You can PM sudodus, the creator of mkusb over at Ubuntu Forums. I don't use server myself.
sudodus avatar
jp flag
@C.S.Cameron, No need for that, I found this question already ;-)
Score:3
jp flag

mkusb can clone most Linux iso files but can make persistent live drives only for Ubuntu Desktop, the community flavours (Kubuntu, Lubuntu ... Xubuntu), Debian live and some respins (distros based on Ubuntu and Debian, where the boot structure is not changed too much).

mkusb cannot make persistent live drives from Ubuntu Server iso files. But you can use the following command line for Ubuntu Live Server 20.04.3 LTS,

sed -e 's# append   initrd=/casper/initrd quiet  ---#append initrd=/casper/initrd persistent --#' -e 's#\tlinux\t/casper/vmlinuz   quiet  ---#linux\t/casper/vmlinuz persistent --#' ubuntu-20.04.3-live-server-amd64.iso > persistent-ubuntu-20.04.3-live-server-amd64.iso

Copy and paste it into a terminal window. It is very important that you get it exactly correct. Otherwise it will fail. Explanation: Editing the iso file can be done within very strict limits. The total size must be preserved and only text strings should be modified. So I replace quietand some whitespace and one hyphen with persistent both for booting via syslinux in BIOS mode and via grub in UEFI mode.

Now you can clone the modified iso file with a cloning tool, for example mkusb-dus or mkusb-plug, for example

dus persistent-ubuntu-20.04.3-live-server-amd64.iso

The result will be a persistent live drive, that works both in BIOS mode and UEFI mode.


I have no method to make it start with a command line. You still have to switch to a virtual text screen with ctrl+alt+F3 (or ctrl+alt+F4 ... and back to the menu with ctrl+alt+F1).

a1716836 avatar
za flag
Strange, I have been able to get persistence working with ubuntu server, it's just that I haven't been able to get rid of the setup menu. So does this mean I could use normal Ubuntu instead, and boot into terminal using `text` as a flag?
sudodus avatar
jp flag
@a1716836, You can try with `text', but I think that the menu in the live server is in text mode. You would have to prevent starting the menu, and I am not familiar enough with the live server to fix that. After all, It is not too difficult to press that hotkey combination.-- By the way, please tell us ***why*** you want to run the live server with persistence.
sudodus avatar
jp flag
You can also consider an installed system, installed like a normal installed system but into a USB drive. @C.S.Cameron is an expert on such systems.
a1716836 avatar
za flag
I want to compile and run a program and store the contents on the USB for retrieval later. It requires Ubuntu to run, and I want to use Ubuntu Server for its simplicity and lack of GUI, which is not needed. More lightweight. I have considered an installed system but this will be running on basically any machine I can use.
sudodus avatar
jp flag
@a1716836, Interesting :-) I think that Ubuntu Live Server can be a good choice for you. The most light-weight Ubuntu alternative with a graphical desktop is [Xubuntu Core](https://unit193.net/xubuntu/core/). If you want version 20.04 LTS, I can upload it. You can easily install whatever tools you need into a persistent live system of Xubuntu Core and run it in text mode or in terminal windows.
a1716836 avatar
za flag
I'm interested! Please let me know where to get this. If I can boot into a terminal with root and it is persistent, that is literally all that is required, then I can sort out the rest.
sudodus avatar
jp flag
Try first with the current Xubuntu Core. Download from https://unit193.net/xubuntu/core/, make it persistent live with mkusb-dus or mkusb-plug. In this case you may prefer using mkusb-dus. If problems with that version, I can upload Xubuntu Core 20.04 LTS (but it is a slow process).
a1716836 avatar
za flag
Apologies, didn't realise that Xubuntu was on a later version than 20.04. I'll give it a go and edit this comment, that should be fine.
a1716836 avatar
za flag
my previous post got deleted. I am now running a persistent live system, not an installed system. Using Xubuntu 21.04 allows me to boot straight into a desktop interface. From here, one can choose to modify /etc/default/grub to make it fully terminal based, or just use the desktop interface. No setup screen at all.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.