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!

2
  • You can PM sudodus, the creator of mkusb over at Ubuntu Forums. I don't use server myself. Sep 28 at 8:54
  • 1
    @C.S.Cameron, No need for that, I found this question already ;-)
    – sudodus
    Sep 28 at 8:55
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).

9
  • 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 at 9: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 at 9: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 at 9: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 at 9:19
  • 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 8 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.