2

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!

1 Answers1

3

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).

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • 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?

    – a1716836 Sep 28 '21 at 09:02
  • @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 Sep 28 '21 at 09:09
  • 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. – sudodus Sep 28 '21 at 09:11
  • 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.

    – a1716836 Sep 28 '21 at 09:19
  • @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. 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. – sudodus Sep 28 '21 at 09:35
  • 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.

    – a1716836 Sep 28 '21 at 09:43
  • 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). – sudodus Sep 28 '21 at 09:46
  • 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 Sep 28 '21 at 10:11
  • 1
    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.

    – a1716836 Oct 08 '21 at 10:20