Results 1 to 18 of 18

Thread: Making the Persistence option default with USB install

  1. #1
    Join Date
    2013-Apr
    Posts
    3

    Making the Persistence option default with USB install

    I've followed the instructions at http://docs.kali.org/installation/ka...ve-usb-install which all seemed to work fine to get a persistent Kali install on USB.

    What I was wondering is, what would be the best way to make that the default option when booting off that USB device, to save from having to manually add "persistence" at the end of the line on each boot?

    Thanks

  2. #2
    Join Date
    2013-Apr
    Posts
    3
    So to provide one potential answer to my own question.

    It's possible to create a custom kali distribution with this specified in the options. Following the kali instructions at http://docs.kali.org/live-build/live...ustom-kali-iso and then using the debian instructions at http://live.debian.net/manual/curren...binary.en.html , I copied over the isolinux directory and then modified live.cfg.in to add "persistence" to the append line. Then just followed the standard USB install instructions with the new iso file generated and it seems to work ok

  3. #3
    Join Date
    2013-Mar
    Location
    in the system
    Posts
    13
    Your 'best' option is to install your live Kali onto another USB device. USB 1 contains the live boot ISO and USB 2 is like a hard drive to install to.

    Go through all the options and select USB 2 as your target media. Make sure when you get to the boot loader option to select <NO> you don't want the boot loader on the MBR of the first HDD on the system. It will then prompt you to enter the location where you want it.
    Select the location (ie. /dev/sdb etc) and it will install grub loader there. You will have a FULL persistent install and you can run encryption as well if you want to.
    The ONLY thing I would change with the standard setup is to remove the SWAP option at the partitioning stage. You should have enough memory on your system anyway. If not, leave it there but be aware that the life of your USB disk may only be a couple of years instead of 8-10

  4. #4
    Join Date
    2013-Mar
    Posts
    3
    You'll have to edit /boot/grub/grub.cfg and add the persistence setting.

  5. #5
    Join Date
    2013-Mar
    Posts
    354
    Do not touch the grub.cfg, you have templates to alter the boot options, then run udpate-grub, which will read those templates, create the grub.cfg with all changes you made..

    The grub.cfg is not to be modified directly (stated in the grub homepage) and is one of the BASIC concepts to keep in mind.

  6. #6
    Join Date
    2013-Mar
    Posts
    3
    Quote Originally Posted by maverik35 View Post
    Do not touch the grub.cfg, you have templates to alter the boot options, then run udpate-grub, which will read those templates, create the grub.cfg with all changes you made..

    The grub.cfg is not to be modified directly (stated in the grub homepage) and is one of the BASIC concepts to keep in mind.
    Although I've edited grub.cfg multiple times and never had a problem, you're right. Thank you for correcting me.
    @OP: Editing grub.cfg directly may be dangerous if you don't know what you're doing. Typos/syntax mistakes can prevent your OS from booting.

  7. #7
    Join Date
    2013-Apr
    Posts
    3
    Thanks for the info. That does sound like a good idea, although I may have to go with the liveCD modification approach this time as it looks like a full Kali install takes more space than is available on a 8GB USB key.

  8. #8
    Join Date
    2013-Mar
    Posts
    10
    According to the GRUB documentation, the template file should be located at /etc/default/grub - however I can't find it in Kali 1.0.3
    It does not seem like the update-grub command is available there either..

    However, in a VM I have running of Kali 1.0.1 both the template file and update-grub command is available.

    Does anyone know how to solve this, I'm guessing there is a package available that will sort it out but I'm wary about installing something that might mess up my current GRUB setup

  9. #9
    Join Date
    2013-Mar
    Posts
    354
    One template is /etc/default/grub, just use nano or any other editor.

    The other templates are under /etc/grub.d, here you can change the boot options, the OS to boot as default, add manually other OS in case os-prober do not detect it, etc..You have many templates:
    00_header, 05_debian_theme, 10_linux, 20_linux_xen, 30_os-prober, 40_custom, 41_custom

    After modifiying the templates, you use grub-update, this will cause the grub to read all templates and will form the new grub.cfg.

    Luck...

  10. #10
    Join Date
    2013-Mar
    Posts
    10
    Thanks, the thing is though, that the /etc/default/grub template does not exist in the 1.0.3 version of Kali

  11. #11
    Join Date
    2013-Mar
    Posts
    354
    Quote Originally Posted by lund99 View Post
    Thanks, the thing is though, that the /etc/default/grub template does not exist in the 1.0.3 version of Kali
    Do you have the /etc/grub.d folder?
    Last edited by maverik35; 2013-05-03 at 16:12.

  12. #12
    Join Date
    2013-Nov
    Posts
    1
    Ok, I was wondering same and was also having problems with installing Nvida driver since Kali docs says:

    "sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub"

    On VMware VM the /etc/default/grub is there but like said above, in the Kali live it is not?

    Other quick questons while here, what .ISO is suggested or should be used for USB? In the kali docs for how to persistence when formatting the patition for persistence it shows his /dev/sdb1 Kali Live only being 832.97 MiB - mine ended up being 2.35 GiB.

    What is the MINI (22MB) version?

  13. #13
    Join Date
    2015-Oct
    Posts
    1
    Okay this maight be quit bit old, in any case.
    In Live Kali linux 2, after you burn the iso on the stick the partition table may look like this:

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 64 1615871 1615808 789M 17 Hidden HPFS/NTFS
    /dev/sdb2 1615872 1770431 154560 75.5M 1 FAT12

    You may be able to mount /dev/sdb2 , let say on /mnt

    "mount /dev/sdb2 /mnt"

    And edit boot files directly at /mnt/EFI/BOOT/live.cfg (whichi is the cfg file for the main menu) you just need to change the "menu default" line to the block you want to be the default boot option. you may also look at other .cfg files and edit them as well.

  14. #14
    Quote Originally Posted by acesso View Post
    Okay this maight be quit bit old, in any case.
    In Live Kali linux 2, after you burn the iso on the stick the partition table may look like this:

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 64 1615871 1615808 789M 17 Hidden HPFS/NTFS
    /dev/sdb2 1615872 1770431 154560 75.5M 1 FAT12

    You may be able to mount /dev/sdb2 , let say on /mnt

    "mount /dev/sdb2 /mnt"

    And edit boot files directly at /mnt/EFI/BOOT/live.cfg (whichi is the cfg file for the main menu) you just need to change the "menu default" line to the block you want to be the default boot option. you may also look at other .cfg files and edit them as well.
    I edited live.cfg and put "menu default" on persistence option

    Code:
    label live-persistence
        menu label ^Live USB Persistence              (check kali.org/prst)
        menu default
        linux /live/vmlinuz
        initrd /live/initrd.img
        append boot=live noconfig=sudo username=root hostname=kali persistence
    but it didnt worked... it doesn't auto select this option on boot

  15. #15
    Join Date
    2015-Dec
    Posts
    1

    Smile Solution For Auto load your choosen Persistence Kali

    Quote Originally Posted by brunoaduarte View Post
    I edited live.cfg and put "menu default" on persistence option

    Code:
    label live-persistence
        menu label ^Live USB Persistence              (check kali.org/prst)
        menu default
        linux /live/vmlinuz
        initrd /live/initrd.img
        append boot=live noconfig=sudo username=root hostname=kali persistence
    but it didnt worked... it doesn't auto select this option on boot
    Hi You must Edit isolinux.cfg with notepad++ in the same directory as live.cfg on the USB drive and set "timeout 0" to "timeout 30" or 50 to make it Autoload 3 sec or 5 seconds Load the Deafault Kali option that you made

    Thats It!
    Have a Nice Day

  16. #16
    Quote Originally Posted by mete777 View Post
    Hi You must Edit isolinux.cfg with notepad++ in the same directory as live.cfg on the USB drive and set "timeout 0" to "timeout 30" or 50 to make it Autoload 3 sec or 5 seconds Load the Deafault Kali option that you made

    Thats It!
    Have a Nice Day
    Didn't worked @mete777

    live.cfg
    Code:
    label live-686-pae
    	menu label ^Live (686-pae)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live username=root hostname=kali
    
    label live-686-pae-failsafe
    	menu label ^Live (686-pae failsafe)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal
    
    label live-forensic
    	menu label Live (^forensic mode)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live noconfig=sudo username=root hostname=kali noswap noautomount
    
    label live-persistence
        menu label ^Live USB Persistence              (check kali.org/prst)
        menu default
        linux /live/vmlinuz
        initrd /live/initrd.img
        append boot=live noconfig=sudo username=root hostname=kali persistence
    
    label live-encrypted-persistence
        menu label ^Live USB Encrypted Persistence    (check kali.org/prst)
        linux /live/vmlinuz
        initrd /live/initrd.img
        append boot=live persistent=cryptsetup persistence-encryption=luks noconfig=sudo username=root hostname=kali persistence
    isolinux.cfg
    Code:
    include menu.cfg
    default vesamenu.c32
    prompt 0
    timeout 30

  17. #17
    Join Date
    2016-Feb
    Posts
    18
    Any update on this?

    i have edited the files but there is no change

    menu.cfg
    Code:
    menu hshift 0
    menu width 82
    
    menu title EFI Boot menu
    include stdmenu.cfg
    include live.cfg
    menu begin advanced
    	menu title Advanced options
    	include stdmenu.cfg
    	label mainmenu
    		menu label ^Back..
    		menu exit
    	include advanced.cfg
    menu end
    
    menu clear
    live.cfg
    Code:
    label live-persistence
    	menu label ^Live USB Persistence
    	menu default
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live noconfig=sudo username=root hostname=kali persistence
    
    label live-forensic
    	menu label Live (^forensic mode)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live noconfig=sudo username=root hostname=kali noswap noautomount
    
    label live-amd64
    	menu label ^Live (amd64)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live username=root hostname=kali
    
    label live-amd64-failsafe
    	menu label ^Live (amd64 failsafe)
    	linux /live/vmlinuz
    	initrd /live/initrd.img
    	append boot=live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal
    isolinux.cfg
    Code:
    include menu.cfg
    default vesamenu.c32
    prompt 0
    timeout 0

  18. #18
    Any update on this? Editing .cfg files doesn't change any grub options. It must have load from another place.

    Seems like it's in iso9660 read-only image in /isolinux/ dir, so there's no way to change it, except regenerating .iso image and writing it on flash again.
    Last edited by maiki; 2016-06-04 at 08:57. Reason: Merge posts

Similar Threads

  1. Kali LIVE USB: Default to "persistence" menu option?
    By nigelmercier in forum General Archive
    Replies: 1
    Last Post: 2015-01-09, 10:48
  2. Replies: 0
    Last Post: 2014-08-17, 03:08
  3. Making Alfa AWUS036H USB default/dominant?
    By f0rge in forum General Archive
    Replies: 0
    Last Post: 2014-04-15, 17:33
  4. Making Windows 7 default boot on dual boot install
    By depth-10 in forum Installing Archive
    Replies: 5
    Last Post: 2013-05-26, 23:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •