Note Regarding Kali 2022
This guide has not been tested on Kali 2022.1 (released Feb 2022). An updated guide will be published shortly.
1. Download Kali Linux 2021 (Live)
In this guide we are using the Kali Linux Intel/AMD 64-Bit (Live) image, which most modern PCs support.
If you have a torrent client, use the Kali torrent download link to speed up the download (10 minutes) as kali.org sometimes throttle web downloads heavily.
2. Write Kali Linux 2021 Live ISO to USB
Note: Before writing the ISO, it is strongly recommended that you delete all partitions from the USB drive if any exist, otherwise it may not boot properly. You can do this using Windows Disk Manager.
Write the ISO to your USB drive using a tool like Rufus, Universal USB Installer or UNetbootin. In this guide we are using Rufus.
- Download Rufus and run it.
- Select your USB device.
- Click SELECT and browse to the Kali Linux 2021 Live ISO you downloaded.
- Set a Persistent partition size, in this example, 4GB, though this can be as large as you want depending on your USB size.
- Click START.
If you see a warning about Syslinux, click Yes.
Click OK if you see this warning.
It may take 10-30 minutes to write the Kali Linux 2021 Live ISO to USB depending on your hardware and size of USB.
3. Boot Into Kali Linux 2021 Live USB
On some PCs, you can simply restart the machine, and if the USB is plugged in, it should boot to Kali Linux 2021 Live automatically.
If this doesn’t work and the PC boots straight back into Windows, hold down the SHIFT
key while clicking Restart in the Windows start menu and select Boot from USB.
If this doesn’t work either, you may need to do some searching on how to boot from USB on your particular machine. Repeatedly pressing one of the function keys (F12, F2, etc) or the ESC or Delete keys on bootup will invoke the boot or BIOS menus on some machines, where you can select USB as the boot device. You may also have to disable Secure Boot in your BIOS in order to allow Kali to run.
When the PC reboots, you should be presented with the Kali Linux 2021 Live boot menu.
In the Kali boot menu, select Live USB Persistence and press ENTER
. The menu may look slightly different depending on your version of Kali.
Kali should boot straight to Desktop. However, if you do get a password prompt, the default username and password in Kali Linux 2021 is “kali”. For Kali Linux 2019 and below, the default user is “root” and the password is “toor”.
To test if persistence is working correctly on Kali Linux 2021, try creating an empty test folder on the Desktop and restarting. Select Live USB Persistence and if the test folder is still there, persistence is working correctly.
Note: From now on, every time you boot from USB, you must select Live USB Persistence in order for persistence to work correctly.
4. Kali Linux 2021 Live Encryption (Optional)
If you want to protect your persistence partition with a password, you can do so with luksEncryption.
Be warned, this process will overwrite your current persistence partition. If you currently have files and settings stored on the persistence partition, you must back them up before continuing with this process.
Reboot the PC and select Live USB Encrypted Persistence and press ENTER
.
Open Terminal and use the root account with:
sudo su
Identify your persistence partition by listing partitions (lower case L, not number 1).
fdisk -l
Output:
Device Boot Size Id Type
/dev/sdb1 * 111.7G c W95 FAT32 (LBA)
/dev/sdb2 4G 83 HPFS/NTFS/exFAT
You may see several entries for devices and partitions listed here. It’s very important that you identify your persistence partition correctly as we are going to overwrite it.
Look for your USB drive. It should have two partitions: One that stores the Kali Linux 2021 operating system, and another persistence partition, which you created earlier.
In the above example, I can see my 4GB persistence partition that I created in Rufus in Step 2.
My partitions are listed here as sbd1
and sdb2
, however, depending on your hardware configuration, these may appear as sdc1
, sdc3
, etc. These will be different for everyone, so make sure you correctly identify the persistence partition for your particular hardware configuration and update the commands below to match.
If you are unsure where your persistence partition is, paste the results of fdisk -l
in the comments below and I will try to assist (lower case L, not number 1).
5. Cryptsetup / LUKS Encryption
cryptsetup
is a utility used to conveniently set up disk encryption using LUKS Encryption.
As my persistence partition is sdb2
, the commands below will reflect that. Make sure to replace sbd2
with your own persistence partition, otherwise you might overwrite data accidently. You have been warned!
cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb2
Output:
WARNING: Device /dev/sdb2 already contains a 'ext3' superblock signature.
WARNING!
========
This will overwrite data on /dev/sdb2 irrevocably.
Are you sure? (Type 'yes' in capital letters):
Type YES
and press ENTER
to wipe the partition.
Output:
Enter passphrase for /dev/sdb2:
Verify passphrase:
Enter a password twice. You can generate a strong password here. Make sure to keep it safe. Once the partition is encrypted, you cannot recover it without your password.
Output:
Existing 'ext3' superblock signature (offset: 1080 bytes) on device /dev/sdb2 will be wiped.
Key slot 0 created.
Command successful.
LUKS Encryption has now been applied to your persistence partition.
Now open your encrypted persistence partition.
cryptsetup luksOpen /dev/sdb2 my_usb
Output:
Enter passphrase for /dev/sdb2:
Enter your password.
6. Create and Label Encrypted Filesystem
Create an ext3
filesystem and label it “persistence”. Ensure you spell “persistence” correctly!
mkfs.ext3 -L persistence /dev/mapper/my_usb
Output:
mke2fs [version] ([date]) Creating filesystem with [number] 4k blocks and [number] inodes
Filesystem UUID: [serial number]
Superblock backups stored on blocks: [numbers]
Allocating group tables: done
Writing inode tables: done
Creating journal ([number] blocks): done
Writing superblocks and filesystem accounting information: done
Label it:
e2label /dev/mapper/my_usb persistence
7. Mount, Unmount and Close Encrypted Partition
mkdir -p /mnt/my_usb/
mount /dev/mapper/my_usb /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
Unmount:
umount /dev/mapper/my_usb
Close:
cryptsetup luksClose /dev/mapper/my_usb
You’re all done!
8. Reboot
Now, reboot the machine and choose Live USB Encrypted Persistence in the Kali Linux 2021 boot menu.
On bootup, you will be promted to enter your password.
Please unlock disk /dev/sdb2:
From now on, whenever you boot up Kali, you must select Live USB Encrypted Persistence in the menu to use your encrypted partition.
Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.
Thanks a lot this helped me😁
I think this is a fantastic tutorial!
It almost worked perfectly for me. Every time I wrote the ISO to the USB it would create an ISO9660 format for the two partitions. Gparted wouldn’t let me extend these partitions so I had to create an additional partition alongside the primary two. I used this command…
fdisk –wipe=never -t dos /dev/sdX
(Follow dialogs, but “n” for the new partition and I used default configurations. Then the “w” option to write the changes to the USB.)
…as suggested in Vojtech Trefny’s reply.
https://unix.stackexchange.com/questions/618615/create-another-partition-on-free-space-of-usb-after-dd-installing-debian
I was able to jump back into your tutorial at Step 3 after creating this partition, and I just targeted this partition as the one to be encrypted. I thought I’d mention it in case you wanted to add a 2.5 step or something.
Looks like there are changes on the kali live 2022.1 or Im wrong?
Hello, I used 64 GB pendrive to and used 50 GB persidtance, then i install application like terminator. but application getting deleted after restart. also settings are restored to default.
Good news. And I think you can add a part of creating new sdb3. Also, it will be good to hear your news about making a standalone Kali installation on a usb drive, full encrypted, the part which I can’t deal with. Thank you big guy.
I can not create persistence partition over 4GB. It is possible?
How big is your USB stick?
Is it 16 GB?
Hello, Thanks for your great tutorial.
I made a massive mistake, I used my_sub instead of my_usb and now no file or folder saves in desktop.
How can I remove this persistence and make another one or what else should I do -_-
Just use win + r and type “diskpart”, then type “list disk” and type “select x” x is your usb number according to the list disk output. Then type “clean” and now go to “this pc” and format the usb with default parameters.
worked for me. Thank’s a lot!
Kali Live 2021.3 won’t boot with Dell Alienware m17 R4 from USB. Secured Boot is disabled. UEFI is enabled.
Disable uefi worked for me
Hi thanks for all it worked! (I made the Live USB Persistence without encryption)
I have a simple question. I get logged in automatically everytime without any login screen. Is there a way to make a login screen for the login so i can put in my USER and my Password ?
Thanks!
Hi I’ve just done this and it works fine once its booted, however if I boot into the installer to install to hard drive the menu is shifted off the screen to the left 3 inches.
Do you have any idea how to fix this?
I’ve fixed it before on a yummy created USB but there was already a place where I could shift right or left in one of the menus.
I did try that in the /boot/grub/live/theme.txt and it got worse.
much of that menu is shifted left 13 % and I tried 0% to no avail.
Thanks, Ranall
it is usually BIOS problem . Try to set different resolution for BIOS
In Kali 2021.3 Live Encrypted persistence settings are not saved, but you could save your data inside the encrypted persistence partition without loosing at shutdown. Use Kali 2021.2, here all your settings and the data that you want to preseve are saved at logout.
Must be a problem with 2021.3? Can anyone confirm?
I confirm, the same situation
Confirmed bug with 2021.3, should be fixed with 2021.3a https://www.kali.org/releases/
I followed all the article but when i boot again into the usb and choose the encrypted persistence option, it is login without any luks encryption.
any suggestions ?
Hello,
After following the guide precisely (and unencrypted persistence working) I cannot get it to work – I’ve tried the official guide, your guide and a video and they all are basically the same, but yield the same, failed, result.
Upon booting into encrypted persistence I am not prompted for a password to unlock the disk – it just boots straight to desktop – and the encrypted partition appears on the desktop as unmounted.
Any ideas as to why this may be? I’m using 2021.3
How can it be done successfully with ext4 luks crypt.
Worked wonderfully <3 Couldn't be a better step by step.
bookmarking this site !
tnx bro
Did everything but when I started back up, the persistence was not there
Probing EDD (edd=off to disable)… _
I get this when I try to boot, is there any way to get back the old tutorial using Universal-USB-Installer and MiniToolPartitionWizard please ?
sir it is possible to install applications/software on kali linux live usb.plz reply
ofcourse it is bro
thanks
This is probably the best tutorial out there.
100%, others are incomplete ****, and the Rufus method is the best because it has automatic persistance mode.
The persistence was working when first done by Rufus. But when I overwritten it to have encrypted one, it doesnt work. any idea why?
out of curiosity, what causes the mkfs.ext3 step to take so long? thanks in advance!
Thank you, a million times! I’ve been struggling with getting my usb up and running because I’m still so new to all of this. You’re the first person who has simplified it so well, i actually know what the hell im doing. You rock!
😎👍
Thanks for this post, I’ve been trying the kali tuto, and I can’t made it, but, yours is nice, thanks.
If only this guide included removing the bleep !!
this is the wrong way round now. You’re running Kali in 111GB and got 4GB only as a hard drive… I’ve used this guide a dozen times it excellent thank you. needs to be sdb1 for the encrypted drive!
430 Comments – damn… glad I wasn’t the only one! I was trying to do this with etcher and running into walls. Thanks!
Brother, thank you very much!
I did exactly as you said. Downloaded Rufus, made de persistent partition (my USB drive is 16gb, so it made a 10gb partition).
Downloaded de Live image at kali.org, put it on the formatet pendrive.
Went to the Encrypted Partition, made all the commands and rebooted twice (in the first time it didn`t save the Wireless wifi, so I got a little bit worried it was not working).
But then I created a new folder and a file in the desktop and rebooted again. Now everything is working fine.
Tks a lot my friend!
Great 😎
works. thanks
Guide has been updated and simplified for Kali Linux 2021. Any issues, let me know.
Didn’t work for me at first, but I checked the /mnt/my_usb/ directory and there was no persistence.config file in there, so I redid this step:
Create a new file called persistence.conf using the nano text editor.
$ sudo nano /mnt/my_usb/persistence.conf
In this file, type / union.
Once that happened, I was able to contain all changes (persistence) after rebooting. Thanks for the write up, exactly what I needed.
Delete my comment?
When starting the pendrive, a black screen appears, with the name of the iso and a 10s counter. When finished, it goes back to the beginning..
https://photos.app.goo.gl/GKhSoByeheAvaes6A
This procedure is not working with ISO 2020.4.
The boot is looped. I tested it more than once and several pendrives.
have you found any solution ?>
This procedure is not working with ISO 2020.4.
The boot is looped.
ive done everything correct but the folder vanished.
My kali is not saving, when I write in the terminal “fdisk -l to show the partitions, it says: Partition 1 does not start on physical sector boundary” PLEASE HELP!!
The encryption works well, but no persistence. What could go wrong? And how can i restart the drive and try again?
Didn’t work on the latest 2020.4 kali distro. The PC fails to even boot past the Dell screen upon reboot until the USB is removed.
rJust did went through this.
Worked first time through with the 2020.4-live-amd64.iso and a 32gb sundisk cruiser. I guess technically I only followed the guide from step 4 and onward. I used rufus and did a dd copy to the usb and used Aomei partition assistent to unformat the persistence partition. Didn’t have to resize anything. After that I followed the guide verbatim and except for not capitilizing ‘yes’ and forgetting to unmount the usb at the very end everything went great. Did the folder test at the end and everything. Thanks for this! I owe you a beer.
Grazie uomo.
tititititiiitititititt
Sucess!t
I created the Kali Live USB boot on a HP Pavilion laptop, and it works great. But when using the same USB drive on an Acer laptop it goes into a 10 second boot loop forever and will not start Kali. Seems to be display driver issue. How do you make the USB drive boot on other laptops? Thanks, Joe
any problem for other OS
well done
great uttorial thanks. Clear consise and straightforward. Only thing to add is that on point 6. Sudo fdisk -l looks like number 1 and its it’s a lower case ‘L’ Must be the font
Persistence and encryption works on 2020.2 but when upgrading. Right around 30-40% it will go black screen and and cursor is blinking repeatedly.
yes sir i got the same problem. so i just pressed control+alt+f3 when the screen went blank and then a terminal of kali opened there i updated the kali again, install gdm3 and kali successfully booted. but now i cant see the network manager icon whcih is on the right hand side top corner used to access the wifi and all. plz help
does this also occurs when we dont have encryption persistence?
when i enter the the sudo fdisk command “sudo fdisk -1” i get an error that says “fdisk: invalid option –‘1’
when i enter the the sudo fdisk command “sudo fdisk” i get an error that says “fdisk: bad usage”
when i enter the the sudo fdisk command “$ sudo fdisk -1” i get an error that says “bash: $: command not found”
lower case L not 1 for fdisk
its “l” for list not 1
Thank you, God Bless you!
sir i made a kali live usbe before and now im here pls answer my questions
It will work for temporary. But when you are using kali linux live with out persistence you can not save any changes.
hey I have got a problem actually its not saving the file after reboot. Help!!!!!
It works very well, thank you!
I made one mistake: Naming the partition of the USB stick “Persistence” instead of “persistence”. The capital letter ruined it the first time I tried. 😉
thanks, i havent named it anf was wunderring why it dint work
This broke my 256GB usb. Now my USB isn’t being recognized at all. This happened during or after the Mini Partition Tool.
Can’t fix my USB. Or this is only good with like a 32GB or smaller thumbdrive?
bro google how to clear n usb and how to delete all partisions using cmd
Use Minitool and Format it
Bro use refus for format ✌️
Your pendrive will be formatted
USE SDFORMATTER TO FIX THE USB
try to hard format it into default. delete all the partitions with minitool. hope it works
so many noobs
Hello !
[FAILED] Failed unmounting /run/live/persistence/sdc1
[FAILED] Failed unmounting /tmp
I used Kali before on another laptop and persistence worked now with v2020.2 i can run live but when i try to go into persistence
i get this errors and it shutsdown after 1min
any susugestions ?
Hello
I’m trying the live persistence for the first time.
Follow all relevant procedures and steps, but still not working and my screen contd turning upside down I.e the opposite way
Please need your assistance urgently.
Thanks
worked perfectly. THANKS.
Hi there! So I was able to log into a live session in Kali 2020.1, but when I try to set up LUKS I get the error “Command failed with code -1 (wrong or missing parameters” when it should be asking me for a passphrase. My USB partition is sda2, but other than that I’ve entered exactly what’s listed. Any ideas?
This was very thorough and useful. Thank you for your work.
Sir I am not able to connect my Kali Linux with my wifi.
And live persistence is also not working.
When restart the pc than it removes my folders which I created earlier.
Plz help me
try ifconfig
and lsusb
Make sure you have space in between / and union like / union. I followed the same mistake and learnt a hard way.
command should be :
correct format
echo “/ union” > your mounted path ex. /mnt/usb
incorrect format
echo “/union” > your mounted path ex. /mnt/usb
can some one please help me learn a bit more about hacking and network testing #newbe
hi,
thx a lot for this tutorial, it was very clear and usefull
may god bless you,
salam 🙂
Its storing the forders but if I change the passwd of the user if I restart its not changing to login to that user I should default password only.
Its storing the forders but if I change the passwd of the user if I restart its not changing to login to that user I should use default password only.
I have done dist upgrade in kali 2020.1 live but after reboot it shows black screen only . What’s the problem here and how to install upgraded tools .
Fdisk command is not working
Actually system commands are not working
Using
sudo
?Hey,
I tried the live usb version on my pc as well as laptop. It worked perfectly on pc which runs on intel i3 processor. But on my laptop, sometimes it shows only blank screen. Even if it boots into the window, there is some graphical/display error whenever i point to any folders or options like blurry color pattern. My laptop runs on Amd ryzen 5. Please help to sort this out. I tried updating drivers. Still no use.
Hi
I installed it twice from start and I know the password is right but it shows as wrong password. It seems to be a problem with latest Kali version and there isn’t any information anywhere on web regarding this issue.
Can you please solve it? Would be greatly appreciated. Thank you
Sir i put 123456 as passphrase but when i type it in passphrase space it shows that it was a worng. Can you solve it
I have the same issue
I installed it twice from start and I know the password is right but it shows as wrong password. It seems to be a problem with latest Kali version and there isn’t any information anywhere on web regarding this issue.
Can you please solve it? Would be greatly appreciated. Thank you
Do either of you have non-US keyboards? I’m wondering could there be some keyboard layout issue.
Thanks G
Kali 2020.1
I completed the encryption process and when I boot, and enter my passphrase it loads for a while and the computer turns off.
Hey thanks for this advice. I made a bootable usb with kali linux 2020.1, I followed these instruction for mounting partition with persistence.conf and unmounted after \ union line added to persistence.conf. after reboot my test folder was missing so this did not work for me. My partition is sdb2 as well… first partition is fat32 lba second is not linux though. Used easy2boot software.
Thank you, this was a wonderful tutorial. Love your work.
With due respect
you have missed “sudo” at the “umount /dev/mapper/my_usb” command.
I labeled the partition with both Rufus and the mini-tool of witch I prefer Rufus but it did not save properly and I had to run the command mentioned in the comments to name the partition and success! e2label /dev/sdb2 persistence
I can’t set “Live system persistence (2020)”. It have always broken, when I tried to launch it and I had 2 ERRORS: “Failed unmounting /run/live/persistence/sdb5” and “Failed unmounting /tmp.”
Hi! Easy to understand for a newbie, Great job!
I did all the steps, but the folder isn’t there after restart, the persistence.conf file is saved and all but no folder.
I did encounter this messege on red after sudo fdisk -l:
partition 1 does not start on physical sector boundry. It could be this the problem?
Thanks a lot!
Same issue. Partition is there and persistence.conf is in the unmounted partition but no saved file or folder on the desktop.
Figured it out directly from the kali.org website. You need to label the partition “persistence”. The OS must look for that when loading the live boot. If you’ve followed the guide completely and still don’t have a persistent boot, while the partition is unmounted (not sure it makes a difference, but just what i did) in the terminal type “e2label /dev/sdb2 persistence”. Per the guide and comments, “sdb2” in the command will be whatever your partition is actually labeled from fdisk -l command. Labeling the partition persistence fixed the issue for me and now I have a persistent boot.
Thanks for the info. It could be that people aren’t labelling the partition “persistence” in MiniTool (or whatever Windows partition manager they’re using). So I might insert an extra step in the guide to check in Kali if the partition is labelled correctly, and if not, to run
e2label /dev/sdb2 persistence
.I tried doing this and it still isn’t working. Cannot get persistent Kali to boot at all. Can you please update the guide with specifics on how to check?
Thank You Man.
I have been looking for this for the past couple of weeks.
Done a great job.
If this don’t work, change Step 4. Create.
Set your new presistence partition NOT as Primary but as Logical. Now everything works 🙂
On your Screenshot ( https://devanswe.rs/wp-content/uploads/2018/02/minitool-partition-step6b.png ) it looks like a lighter blue, so do you used Logical too?
Sorry for my bad english…
I love these h4xx0r5 reporting problems without even trying a bit further from just copy&paste. You should be ashamed of yourselves (╯°□°)╯︵ ┻━┻
How do I make persistence the default boot option, anyone?
I dont have the exact method, but try searching “Edit grub2 boot options”
you would have to edit the grub options. it is possible and i did it once before long ago. it requires editing configurations files. look it up. 🙂
kali@kali:~$ sudo mkdir -p /mnt/my_usb
kali@kali:~$ sudo mount /dev/sdb2 /mnt/my_usb
kali@kali:~$ sudo echo “/ union” > /mnt/my_usb/persistence.conf
bash: /mnt/my_usb/persistence.conf: Permission denied
After step with “echo…” i had bloker with “Permission deined”
I already try to use:
sudo sh -c “echo “/ union” > /mnt/my_usb/persistence.conf” and the result was:
kali@kali:~$ sudo sh -c “echo “/ union” > /mnt/my_usb/persistence.conf”
/
I had just “/” as result of my command. Then i create new folder on the Desktop to check if this changes will save. Restart PC, go Kali Linux Live with Persistence – my folder did not saved..
Do you know what the reason and how could fix this behavior??
The guide has been updated. Please re-read that section as there are some privilege changes in Kali 2020.
Log in as root and then redo the procedure ( it should work better than sudo), kali 2020 logs in as non-root by default
how can I log in as root kali 202 got rid of root default?
You don’t need to be logged in as root in Kali Linux 2020 to follow this guide. Just make sure to prepend
sudo
to all your commands.If you want root for Kali 2020, try running:
Select Enable password-less privilege escalation and press
ENTER
.More info https://www.kali.org/news/kali-default-non-root-user/
you can also use
sudo -i
Hey i have issue when i type my passphrase i
in the encrypted persistence boot menu
The computer shutdown and he is write” failed unmounting tmp ” and same for /run/live/medium
Kali linux 2019.4
I have the same problem too, but I he don’t show any error msg. Kali Linux 2020.1b
Everything is followed as guided through, but the persistence isn’t working in Kali’s settings or folder creation in the desktop – as soon as i restart it goes back to original, Kali Version is 2019.4 – it does save the folder in the encrypted partition though, but nothing settings wise or let’s say if i update or upgrade nothing gets saved after restart – please help?
echo “/ union” >/mnt/my_usb/persistence.conf
I’m facing problems in latest version of kali . In Configure Persistence Partition
Problem solve . It’s my mistake .
Sry !
Thank you very much. Quick question.
When I get to the persistance phase, the command “mkfs.ext4 -L persistence /dev/mapper/my_usb” doen’t work, it tells it doesn’t exist
any suggestion??
thank you very much
that might be because Linux gave the partition a different name. check by running sudo fdisk -l
I booted successful but there’s a small error “failed to set keymap” I that a problem
I followed instructions and partitioned usb correctly. After booting into live w/ persistence i entered the remaining commands. The first three went fine but the fourth not so much. How do i correct this?
mkdir -p /mnt/my_usb
mount /dev/sdb3 /mnt/my_usb
echo “/ union” > /mnt/my_usb/persistence.conf
umount /dev/sdb3
Umount: /dev/sbd3: no such mount point specified
Try umount /mnt/my_usb instead.
“umount: /mnt/my_usb: target is busy.”
A big thank to you finally I did it
**newest kali linux build on 512 gig usb device. used YUMI multiboot. Followed your above directions and also read the comments. Took over 8 hours to complete. Didn't make a test folder. Rather took a screenshot of terminal window. After restarting, I'm getting a failed to set font and keymap…(hmm, that doesn't sound too serious). Booted up, but the image of the terminal window wasn't in Pictures folder. Shut the windows machine down and re-started from usb again. Still no picture. Anyhow, then used sudo systemctl restart console-setup.service. Saved that command on a text and saved to documents. Also, put a Folder on the Desktop. Rebooted into the Windows. Then shut down and booted into Kali (from the usb). When it started this time, the folder is on the Desktop and the saved text is in the Documents folder. So, it's working. Still trying to figure out the "failed to set console font and keymap" at start-up. Thank you for your time. I'll take it from here. 🙂 Have to search out some more of your stuff… cheers
Whenever I boot my system into Kali Linux with encrypted persistence, I get to the point where I am supposed to enter my passphrase, which I enter, but then when I get to the desktop, the test folder is never there. I then check the file manager, which has a device labeled “26 GB Encrypted” in the left hand column (I am using a 32GB USB with 6GB for the operating system and 26GB for persistence). I click on the device and I get prompted to enter the passphrase. After I enter the passphrase, I get an error that says ‘Unable to access “persistence”‘. More specifically, it says:
Unable to access "persistence"
Error mounting /dev/dm-0 at /media/root/persistence: wrong fs type, bad option,
bad superblock on /dev/mapper/
luks-1971d87e-5c90-414e-88b3-43a30fca485d, missing codepage or helper
program, or other error
I have tried this on both Kali Linux 2019.1a and 2019.3. I can’t figure out what the problem is. After the first time it didn’t work I started just copying and pasting the commands into the terminal to make sure that I wasn’t mistyping anything, so I know that the problem isn’t the commands being mistyped.
try naming the partions without space .
Am Awed…..
Best ever How-To.
10 star for this.
After doing this when I set a root password it just reverts back to “toor” the next time I boot into it. The instructions you provided worked like a charm but I was hoping you could help me with this further step.
Thanks.
I tried both kali-linux-large-2019.3-amd64.iso and kali-linux-2019.3-i386.iso in 2 different 8GB USB. I followed step by step
/dev/sdc1 4.7G c W95 FAT32 (LBA)
/dev/sdc2 2.8G 83 Linux
mkdir -p /mnt/my_usb
mount /dev/sdc2 /mnt/my_usb
echo “/ union” >/mnt/my_usb/persistence.conf
umount /dev/sdc2
but it didn’t work well.
Pls help.
I tried your way twice, with the 2018 and 2019 Kali version, and both worked well. This is an excellent guide!
Actually, the second time I wanted to use a different way. I am using Rufus to create Live USB, and it allows creating persistent partition directly when writing the ISO. The partitions were created, but for some unknown reason, the persistent one got filled up very quickly. And I was left with 0 bytes left. I tried it twice, but the same thing happens, in no time I got 100% usage.
Then I try your way again. I let Rufus create Live USB with no persistent partition. Then resize the partition, and create persistence.conf manually. Until now, it got only 11% used and I already install so many more. I am still wondering, what when wrong, but I left the questions for a later time.
nothing saves to the desktop ? 🙁
same issue
I followed all the steps. This is the most concise, clear and objective “How-To”.
Thank you for the work.
Your a genius I got it persistence and everything, finally thank you again.
I cant get Kali 2019.2 at all except for failsafe mode but you got me that far nothing else was working even near this well. I did get Kali 2019.1 to boot right up one problem though persistence isnt working could you please post how to fix that. Kali was kicking my ass but you got me going would be nice if I didnt have to start from go though every time I log on. One last thing some douche put in the comments about one of your commands being off the one that starts with echo. He’s nuts I typed it just as you had it and it worked perfectly. The second time I booted Kali I tried it his way hoping persistence might work it wont accept it his way. Would love it if you did something on a tool that actually works well for pentesting, been using Aircrack-ng and Hashcat on Unbuntu but man is it slow going. Thanks again and please if you can could you post how to get the persistence to work.
Everything works well but when shutdowning it is not shutdowning at all
It is showing”a stop job is running”
Try shutdown –force
Amazing, just trying it at the moment but this information was clear, updated and simple as it should be, thank you very much!!
This works flawlessly on Kali Linux 2019.2 amd64. Best “how to” ever; clear, concise, well written. Thank you so much. Spent needless hours trying this, till we found your tutorial.
Just awesome! Thank you again.
My mistake (as English is not my first language) was that I misspelled PERSISTENCE… instead I wrote PREsistence… after I’ve fixed that it works.
Everything works IF you also do these things:
Remember that the OS might be bigger then 4GB. Adjust for that if needed.
Set your new presistence partition NOT as Primary but as Logical. (VERY IMPORTANT).
echo “/ union” > /mnt/my_usb/persistence.conf // ( > /mnt) this commando is wrong.
echo “/ union” >/mnt/my_usb/persistence.conf // ( >/mnt) this commando is right.
The diffrence is the space. (> /mnt…) –> (>/mnt…) as mentioned by Cristian Ritter in the comments below.
Other then that, nice tutorial!
I’m using a 32GB 3.0 flash drive, so I know that space isn’t an issue. I also increased the initial partition resize from 4 to 5 to see if that made any difference, but has not.
I missed the comment about the space in the command being incorrect, I will give that a shot. Thank you!
Well, I sure hope you are right. I can’t tell you how long I have trying to get this to work. It doesn’t seem to hard to do at all. But the system just won’t recognize the persistence partition what-so-ever. Thanks for the input on what to try,
I’ve followed the steps a few times with Kali 2019.2 and can’t seem to get anything to save. No errors in the commands, but nothing saves when I reboot.
sdb1 is same of sda1? in my case the created empty folder not show after restar kali USB persistence.
Mine kind of worked. I cant save a folder to the desktop, but it looks like a usb drive is mounted called persistence… Clearly I did something wrong. And tips?
Can I set persistence and load nvidia drivers on any pc that uses an intel gpu, then be able to use that live usb with other pc’s with nvidia cards? Thank you very much
when I used fdisk -l
I got an output that has the /dev/sdb2 as hpfs/ntfs/exFAT and not linux
then when I tried to mount /dev/sdb2 /mnt/my_usb it failed saying bad superblock on /dev/sdb2, missing codepage or helper program, or other error.
Any advice from here would be appreciated. I followed all of the steps above and one thing that happened that wasn’t covered was that it asked me to format the drive after I selected Apply at the end.
Excellent! Thank you! I had a persistent partition before, but with your tutorial everything is persistent. Love it!
Thank you. Works perfectly with Kali 2019.2 on my 2018 MacBook Pro.
It works with 2019.2 and macbook pro late 2013
Great, thanks for the feedback 🙂
i exactly did what u have touhgt but i dont know where im mistaking
If you get an error say “bash : unmount command not found “ MAKE SURE YOU ARE SPELLING IT RIGHT ITS “umount” not “unmount”
it worked bro thank you so much
i followed same command as yours but not save changing…help me
2019.2 works?
Unmount /dev/sdb2 is not working
umount and not unmount … 😉
I have already followed this tutorial, but when everything is finished then I reboot the persistence again then a boot failure occurs (end trace ***********)
please make a video
Or give your address and he can go there to do this stuff for you lol 🙂
This is an awesome guide. Thanks. Can this work with other Linux distributions eg Ubuntu? or only on Kali?
I already test all persistence it is not working, if i reboot all folder are gone, i use RoG strix how suppose i do?? Sorry for bad english
it gave me a error in minitool when i tried to do both commands at once so i split the tutorial and resized partition then apply and add new partition ext4 then applied all ran sweeet thanks
also provide how to recover your pen drive from bootable pen drive
I think so many people wrong when write command in terminal!!!
No im not having the folder after rebooting
After creating the persistense partition, rebooting takes me to the grub loader with a console instead of the kali menu. I’ve followed the instructions to the dot. What may I have done incorrectly?
Did you ever figure out? I’m stuck at the same spot..
Hi, so I already have kali linux on my usb drive but I am on a macbook pro and dont know how to set up a persistent partition, please help.
Thanks
Disk /dev/sdb: 14.3 GiB, 15376318464 bytes, 30031872 sectors
Disk model: Ultra Fit
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x61924af6
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 8390655 8388608 4G c W95 FAT32 (LBA)
/dev/sdb2 8390656 30031871 21641216 10.3G 83 Linux
It does not work for me when i reboot it
I have version 2019.1
kali-linux-2019-1a-amd64 works for me, but using Rufus instead of Universal USB Installer. Setting Rufus with GPT partition style. Try!
Type msinfo32 on your windows cmd and look the BIOS Mode of your machine, mine is UEFI, so i had to set GPT partition, on Rufus, to boot.
Thanks!! Works for me in kali-linux-2018.4-amd64, but i had to write the ISO to my 500G USB HD using Rufus setting GPT partition style (UEFI boot).
Note that Windows 8 and later versions can only support UEFI, it can not boot from the traditional MBR disk.
I mean, the boot environment on my computer is UEFI, not BIOS.
All ok, but It does not save the configuration
Hey there, having a strange issue hoping I can get some advice here.
I’ve done this before in the past and I’ve followed this guide to the letter, but whenever I boot from the USB and select the “encrypted persistence” option it asked me to unlock /dev/sda3. I enter in the exact passphrase, and it just tells me there’s no key slot with that passphrase. From what I see in kali (running in VM) there’s only two partitions. Just does’t make sense to me. please advise.
Do you have any non-alphanumeric characters in the keyphrase? e.g any symbols?
Yes I do.
However I was under the assumption (from what I found googling the issue) I could use symbols from the 7-bit ASCII Table?
I was able to figure it out, The laptop I was booting the USB from also had a LUKS encrypted partition and was asking for that passphrase first. I had to enter a bad password then select “no”. After that I was prompted to enter the passphrase for the correct partition.
2019.1a works aswell Good Guide! perfect for starting into the new Linux life!
I’ve had 2 partitions there one with size set to 3.24 (Other) and second with size like 364kb (FAT16).
I’ve followed every step carefully but still didn’t worked for me. Please, help me.
Follower everything carefully, completed every step and IT DIDN’T WORK
followed*
echo “/ union” > /mnt/my_usb/persistence.conf this commando is a bit wrong
right command is
echo “/ union” >/mnt/my_usb/persistence.conf
nice tuto.
Thanks
Lol thats make sense than!
How to install tor browser in kali linux live persistence
Run apt-get update
Run apt-get install tor torbrowser-launcher
Then, see Applications menu under Usual Applications and Internet. This shortcut will only work if you’re not running as the root user.
Thanks for the guide but the partition magic tool broke my standart windows PC on the hard drive. It asked to reboot windows to finalize the work on the USB stick now it just won’t boot anymore 🙁
Thanks for the guide, it’s very well written. The partitioning and installation went flawlessly. However I do have an issue with the thing running extremely slow, like
apt-get update && apt-get dist-upgrade
takes more than a whole day to finish installing after downloading 1GB of files.I use a 64GB Kingston 3.0 USB, plugged in to a 3.0 USB port.
The machine has an i7 8550U processor and 8GB RAM with a Windows 10 main operating system. I have disabled secure boot in order to boot from USB. Perhaps you will have a clue and point me in the right direction on how to solve this? Is it the BIOS settings that require some modifying?
I used the 2019.1 image for Kali.
Creating file system section of tutorial was almost flawless, I ran into errors due to usb label having a space in it but finally got it working by only using the fist part of usb label, ie Kali Live to just Kali where the usb label was needed. Thanks for a great resource!
How do i know my device name ??
Works as well with Kali Linux 2019.1
Excellent! Tested with kali-linux-2019.1-i386.iso. Thanks!
Didn’t work for me with 2018.4. It doesn’t safe any settings changes.
Any idea?
use these commands instead
fdisk -l
mkdir -p /mnt/my_usb
mount /dev/sdb3 /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
umount /dev/sdb3
exit
But whats the difference? It might be
sdb3
for you but not for others.please wrong on site indication.need correct fdisk -1 to fdisk -l
it’s not ‘1’ actually its just the font
anyone having a problem, just use win32 disk imager and write the iso with it instead of Universal USB Installer and complete with the rest of the tutorial.
I’ve just done it with Kali 2018.4. Works perfect! Thank for such a full guide!
(For those one who has discrete nvidia card and stuck at firts boot – press e when choose kali boot option and type nouveau.modeset=0 in the end of “Linux” line)
A very good guide but … l have a little trouble that when I created a passphrase and verified it, but the Teminal got this to me:”Command failed with code -1 (wrong or missing parameters).” So I just wander how to solve this problem, thank you very much!
This guide worked almost flawlessly. In the end, following these instructions did give me a bootable USB with Kali + Persistence; however I was not able to resize the partition. I’m using a pretty standard Lexar USB and no matter where or how I tried, it wouldn’t give me the option to resize. I’ll likely try again with another USB stick, but I wanted to confirm that even though I couldn’t resize – simply creating the new partition and following the rest of the guide still results in a successful configuration.
Not working on 2018.3
same problem
What a superbly-written piece. Direct and concise and accurate.
Thank you very much.
Hi and thank you very much for this amazingly put together tutorial. The only problem with my attempt so far is that I get stuck at step “4. Boot Into Kali Live USB”. I have created the persistence partition, resized it, process was complete, safely removed USB and then restarted laptop, entered boot menu, selected my flash drive but it doesn’t want to boot from it. I am using a new 64 GB flash drive (bought yesterday specifically for this purpose) and I’m stuck. The Kali Linux .img is 2018-4, checksums checked ok. I want to mention the fact that the drive is defo working fine, as I have previously installed ubuntu and mint on it, and managed to boot both distros just fine (but couldn’t get persistence to work on them, so decided wo get kali, since I’m studying cybersecurity @ university) (might have given you a bot too much background info there 😛 ). Any suggestions at all…?
Try going into your BIOS and disableing “secure boot” under your boot settings. After restarting and doing the code confirmation then try booting to the usb. That’s what got mine to work. If it’s any help I was trying to run it on an HP laptop.
Nice one!
Got this working as described in article on first attempt. Thanks very much for this guide as its much more thorough than what is provided in the official Kali Docs.
FYI I used 2018.4 amd64 image with SanDisk Cruzer 16GiB USB drive.
Works like a charm.
Firstly, I didn’t understand what I’ll write to my_usb.
Second, I wrote persistence.
Third, my Linux gives SCHED_ERROR 20 []
Please help me
After following the steps and trying to boot into Kali grub says you must load the kernel first. Did I miss something?
After starting the live mode, the monitor goes dead. Only the console works after pressing ctrl+alt+F2.How fix this?
I do everything as it comes out in the post and when I go to the partition wizard I get something bad is wrong and instead of blue I get black
Any idea why I cannot mount/unmount my persistence partition?
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 10485759 10483712 5G b W95 FAT32
/dev/sda2 10485760 115343359 104857600 50G 83 Linux
root@kali:~# mount /dev/sda2 /mnt/my_usb/
mount: /mnt/my_usb: /dev/sda2 already mounted or mount point busy.
root@kali:~# umount /dev/sda2
umount: /dev/sda2: not mounted.
Thanks alot. Brilliant work
Error shows while formatting partition for persistence . Says mpw cannot create partition in this removable drive . You need to delete all the partition.
THANK YOU!!!!
After hours of frustration, came upon this page, followed the instructions and got my live usb with persistence encryption working straight away. And I’m a newbie…
Brilliant. Thank You so much!
Good to hear 🙂
this works, but after enabling persistence, kali is ridiculously slow.
I can barely open directories in the gui or firefox, even on an i7/gtx1070..etc…
is there some swap file or something we are supposed to enable?
I’ve gone through the process on two different usb’s both 2.0 and 3.0 and
it doesn’t resolve the lag issue, also tried on different usb ports
What kind of USB do you have a portable drive or an portable USB and also how many gigs?
Why after umount /dev/sdb3 I type reboot and it’s just freeze. Please, can anybody help with that? I’ve tried a lot time.
It’s working at 2018.2! Fantastic, ty!
I do exactly step by step. I used 16gb flash drive on my loptop without hard drive. one partition of flesh drive I left 4,5 gb for kali linux. second 10gb for persistence….but still kali linux x64 won’t save any files or settings…. all commands works without any fails.. Actually I see config file of persistence, and in opened file I see just this: / echo and nothing else…. Help … I tied diferend methods but still not working…. I spend 8h to searching how to fix it…. but nothing helps me…. cmo’n… ://////
Works with 2018.4
Great!
when you say this works, do you mean you can save files to the persistence drive, or all changed settings are persisted?
I can save whatever file, but only in the persistence drive/folder. not on the desktop or anything.
and any changed settings are lost.
is this a limitation of kali live persistence?
Finally a straight forward guide that ACTUALLY WORKS correctly.
many and much thanks!
I’m using 2018.2 and I try to do the command for create new partition, it failed for mount /dev/mapper/my_usb /mnt/my_usb saying mount does not exist. Anyone can help me ?
Try to update/upgrade your system and reboot.
Syntax:
sudo apt-get update -y
sudo apt-get upgrade -y
reboot
Or just
sudo apt-get update && sudo apt-get upgrade && reboot
i got an error: “fdisk: cannot open /l: No such file or directory
stupid AF -l not /l
This worked exactly as described. Installed 2018.3a on a 32G thumb drive; tested fine. I have a test folder on my desktop and it retained my wifi settings. Thanks!
I tried with the newer version 2018.3a x64. It doesn’t save anything except inside encrypted partition.
I’ve to clearify that i followed the guide partially, i created the partition inside kali with the native “Disks” tool. I don’t think change nothing but i want to specify
I followed the guide using 3a and it has worked
Thanks for letting us know.
I did the same like several times with 32 gb usb of know how brand and after reboting every thing is gone i am again like a new user
I followed the same steps like several times with 32 gb usb of know how brand and after reboting every thing is gone i am again like a new user
same, already tried so many things
don’t know what’s wrong 😢
how can i use some left space of my flashdrive for files that can be access on windows? I’d already installed bootable kali linux with space for persistence.
Make a bloody ntfs partition that windows can see it download tools on qindles that grants support for ext4 filesystem..
mkdir -p /mnt/my_usb
mount /dev/sdb2 /mnt/my_usb
echo “/ union” > /mnt/my_usb/persistence.conf
umount /dev/sdb2
—–here I made a mistake with “umount /dev/sdb2”. I found it on time and changed it. repeat these operation again. it seems everything is okay. I created a new folder in desktop, after restart, I can’t find it 。。。
Just done this today, worked perfectly with 2018.3 thanks!
Note: This can also be done without MS-Windows installed. You can even use a PC with no drive, just using another live system from DVD or USB stick (eg Lubuntu LTS). Be sure gparted is on the other live system. Gparted works similar to the windows tool shown here.
But if you have a Windows system anyway somewhere, this is a very nice way to do it.
PS. if you like to change the default password and autologin option, there are hints in the net, too.
Anyone know if the issue is resolved in Kali 2018.3a?
I followed the guide using version 3a and can confirm it works correctly
I have done this with the 2018.3a version, worked perfectly fine. Thank you for this useful tutorial.
Great, thanks for letting us know 🙂
Only works on Kali 2018.2 but you can still update.
every time I follow this tutorial or any tutorial for that matter it doesn’t become persistent.
the partition part of the usb is always showing up after attempting it. also should i do this all in the first live system or the persistent mode as i have read that on other tutorials that you cant start it in one system or the other. i had achieved this in 2016 with the same usb however now it no longer works. any possible reason why?
It works perfectly with 2018.2 image! Thank you so much! The best guide on the Internet!
Great!
I didn’t see the “Please unlock disk /dev/sdb2:” message and my test folder disappeared after reboot =(. I used 2018.3 amd64 image. And now I’m going to use the previous release (2018.2). Hope it will work.
awsome dear friend it works on my first time.
thank you bro.
can please guide me “how to disable live system encrypted persistence”‘also .. the proper way u guided above how to setup live system encrypted persistence.
it would be great if u share this one also.
thank you once again.
Hi, any news? did they fix it on W37 ?
I’m not sure yet, I haven’t had the time to test it. And there isn’t any discussion about this on the Kali forums from what I can see. If anyone else could test I would be grateful! 🙂
Windows with Kali Linux?
Works! Commenting from an encrypted persistence live boot.
“Running apt-get update && apt-get upgrade” now to see if moving to the latest breaks anything, will report back.
Great. What image did you use in the end?
2018.2 amd64
looks like the problem is w/newer versions of dm-crypt I think. When I ran apt-get upgrade and it got to updating, it provided me with a warning about how the hooking method that was being used will be deprecated soon. It’s fine I guess if you already have an encrypted partition setup, but if you try to create a new one, nothing.
I will find the exact warning and post it here later.
Great. Thanks for the update 🙂
when i rebooted, it asked “Please unlock disk /dev/sdb3 and it had worked.
but when check “new folder” i was created, nothing was saved.
what should i do ?
solved.
my mistakes, i less space on —> echo “/ union” > /mnt/my_usb/persistence.conf
thanks you.
Thanks for the feedback. Which image did you download by the way, was it 2018.3 or an older version?
version 2018.2-amd64
Looks like the problem is none of the things I mentioned before: https://www.reddit.com/r/debian/comments/8yxiud/livebuild_issue_getting_persistence_with_luks/?utm_source=reddit-android
Sounds like the latest 2018 Iso (including weekly builds so far) have this problem. Building encrypted persistence is hard-borked…
Oh dear. Thanks for the update.
If anyone is having issues with Kali 2018.3, try downloading the previous version 2018.2.
https://cdimage.kali.org/kali-2018.2/
Hello!
i multiple times have created a new USB Stick after this instruction, but Kali does not auto mount my Partition with encrypted persistence??
I dont know why! I have also tried other Instructions, that i have found in Goolge, but same error!
Without the encryption it works, but with encryption kali does not ask me for a password, when i boot from my USB!
I also have tried several Notebooks…
Can you help me?
And sorry for my bad English, i am a German User with terrible English Skills =)
Best Regards
Mark
Try downloading a previous version of Kali (2018.2)
https://cdimage.kali.org/kali-2018.2/
Very nice! Worked on first go
help me i also want to use this usb on my home theatre which i plug in using usb.
Story time:
This command – “mkfs.ext4 -L persistence /dev/mapper/my_usb” – is the culprit
For whatever reason, after running this command, the type of drive shown from “fdisk -l” still shows “Microsoft Basic Data” for the drive.
I figured it out by using the mkfs command while going through your other guide instead of setting up the partition as EXT4 when I start with miniTool partition wizard. lo and behold, I saw with a quick fdisk -l afterwards that the type hadn’t changed
So I ran Gparted and reformatted the partition as EXT4 and labeled it “persistence”, now when I run fdisk -l it shows “Linux filesystem”
Restart into the persistence option and BOOM! Mission accomplished.
I would recommend perhaps modifying the guide to run “Gparted &”, and format the partition as EXT4 after using the cryptsetup luksOpen command instead of mkfs. If you want to keep that step as command line, when running Gparted it shows you what command it does to sucessfully change the partition.
Ok, thanks for the feedback. I cannot recreate the problem here though I’ll need to do more tests.
The partition shouldn’t be showing as Microsoft Basic Data. When you run
fdisk -l
when first booting into Kali, the persistence partiton type should show asHPFS/NTFS/exFAT
. Are you sure you created it as unformatted as specified in Step 3. Create Persistence Partition?I think I’m having the same issue. After running “mkfs.ext4 -L persistence /dev/mapper/my_usb”, fdisk-l continues to show the partition as “HPFS/NTFS/exFAT.” By using Gparted, I am able to format it as EXT4 and get it to display as “Linux”. Unfortunately, Kali still ignores the persistence.conf when I reboot. I formatted my persistence partition as “unformatted” in step 3.
Which Kali image did you download?
When I rebooted, it asked “Please unlock disk /dev/sdb2” and I thought it had worked. The second time I rebooted it didn’t ask for a password, and nothing was saved. The persistent encrypted partition is there, it just doesn’t boot off it (I always chose “Live system (encrypted persistence, check kali.org/prst)”).
Incredible guide man, I was having so many strange issues following the instructions at kali.org/prst or whatever.
I’ve followed this guide word for word, no luck.
Everytime I boot and choose “encrypted persistence”, it does not unlock the drive upon boot. I boot into Kali’s gui first, root toor, then I have to use “cryptsetup luksOpen /dev/sdb2 persistence” and then mount it.
Because it doesn’t unlock the drive on boot, it can’t read the persistence.conf file, so no persistence is maintained.
I’m using kali-linux-xfce-2018.3-amd64.iso as my image (I ran a hash check to confirm it’s good). I’ve imaged using rufus, UNetbootin, and DD. I’ve managed the partitions using Windows disk manager, gparted, parted, and the minitool partition wizard.
I’m imaging on to a 32 gb flash drive (I’ve tried two different ones to see if the hardware was causing the issue). I’ve flashed the image as a GPT filetable and MBR. I’ve booted using UEFI and legacy.
Could really use some help.
Do you get the message
Please unlock disk /dev/sdb2
on boot?A lot of these issues are caused by an incompatible USB drive. Is the second USB you tried the same brand? Also if possible try creating partitions on a different computer as there could be some other USB hardware issue. If you can pick up a new USB drive, I recommend the SanDisk Ultra USB 3.0 Flash Drives. I have loads of them and they’ve never failed me.
Nope, no message on boot to unlock /dev/sdb2. As for the brand, both of them are SanDisk, one is a Cruzer Glide 32gb, the other is an Ultra 32 gb.
I will try to create the partitions on a different machine and report back.
Nope, tried on a different machine. Nothing.
On a related note, I just noticed upon startup as it loads
“sdb sdb1 sdb2
WARNING: unable to load module dm-crypt
WARNING: cryptsetup is unavailable”
I think there might be something wrong with the xfce version of Kali…I will try the base image and report back”
Nope. That didn’t do it either. No warning this time for dm-crypt or cryptsetup either…or at least one that I can see… 🙁
That’s a pain. And
sdb2
is definitely the right partition? Trycryptsetup -v luksFormat /dev/sdb2 --debug
in Step 5 to see if any errors come up in the debug.Also see if you can get unencrypted persistence working using my other guide. If that works, then you know your USB and partitions are ok and it’s some other issue with encryption only. Also try and copy and paste the commands from the guide just to rule out typos, and make sure you have the correct device,
sdb2
, etc.Same problem here!!!! looks like Kali forgot the module on the new version
I can’t believe I’m about to say this because I am a total noob, but I think I might be able to offer some insight here.
I think it’s an issue with the new Kali version 2018.3
I followed the instructions above like you and installed the newest ISO which is 2018.3 but it doesn’t prompt you for the password during the boot sequence anymore. When you boot in, you can unlock your persistence through the Places> menu and selecting the encrypted drive but it seems unstable.
I am a total noob, so please take everything I say with a big pinch of salt, but if I had to make a largely uneducated guess, I would say it seems to be an issue with the persistence partition not mounting correctly on boot.
If you follow the instructions above to the letter, but instead go back to using the 2018.2 ISO, (which is still on the kali index website), it will work perfectly. The upgrade to the new kali version from within using apt upgrade command, that might work for you.
Like I said, I am a completely newbie so I might be way offside here, but thought I would share what I’ve seen.
Good luck, let us know if you figure it out.
Thanks for the feedback. For now I would recommend people download Kali 2018.2 until we can get some more definitive feedback from the community.
Hi, thank you for your guide.
I followed the steps many time, I tried with a complicated passphrase with symbols lowercase and numbers, and then I tried again only with lowercase and numbers.
And everytime I ve got this error : IO error while encrypted keyslot.
Command failed with code -1 (wrong or missing parameters).
What should I do?
What happens when you run
where
sdb2
is your persistence partition.Thank you for your quick answer. It says it will overwrite data on dev/sdc2 I put YES. It asks me to enter my passphrase, then to verify. I post you the complete lines. ibb.co/gV96Q9
It seems to be having problems writing to that partition. All I can suggest it that you format your USB and try creating the partitions again from scratch. Or if you can, try on a different USB drive.
You found the issue, I tried from scratch, and it goes wrong again.
Then I tried from a different usb key, and everything is working perfectly now, thanks to you.
You are a savior. Thank you so much.
Take care
No probs. Yes, a lot of these issues are caused by an incompatible USB key.
Dear,
I’ve followed your procedure with success but we I’ve rebooted the machine I lost every time all configurations (keyboard, wifi password, etc.) and also all apt updates.
I’ve used this iso: kali-linux-2018.2-amd64 with a 32GB pendrive.
Have you any idea?
Thank you!
Rgds,
Davide
Great work for me
If I want to be sure no data can be stored on the USB drive, can I just unmount the encrypted partition ?
Then don’t set up persistence at all. Kali live doesn’t write to the USB unless you set up persistence.
This guide also works for PARROT OS.
👍
I get an error after the line
mount /dev/sdb2 /mnt/my_usb
Something about not finding anything there
Does
sdb2
exist? Make sure you have the right device name and follow step 5 carefully.Where does the persistance live? I mean where is the encyrption with this set up? Is it the whole disk or partition? Or is it just the users home directory for instance?
Cheers – great article
The entire persistence partition is encrypted. e.g
sdb2
and this is where your home folder resides. The 4GB system partition (sdb1
) is not encrypted because otherwise you wouldn’t be able to load the LUKS encryption software on boot.Thanks
I suppose this is my issue, insofar as I would want logs, browsing history, passwords, well everything really. Someone could just get the USB Drive and access all you have been doing in terms of software etc
Thanks
All that will be encrypted. The persistence partition is where files, settings, logs, etc, are saved to. The partition where Kali resides is not written to at all. It’s a Live USB and is therefore effectively read-only.
Yeeeesssssssss!!! 🙂
Thanks, great stuff cant wait to get started
I’m having a hard time getting this to work. I followed the guide as exactly as I possibly could, and yet when I turn off the system to reboot the log says failed unmounting /lib/live/medium. Then upon booting in encrypted persistence, I get to the point where it says Please unlock disk, and I type my password in and nothing happens. I have to force shutdown. What could be the reason behind this… I have cleaned, repartitioned, and reformatted the usb many times now to no avail. Thanks for the help
When you type your password, there is no feedback in Linux like there is in Windows/Mac, eg. no stars or dots. This seems to throw off a lot of people. Just type your password carefully and press enter.
Thank you, I should have clarified that I understand there is no visual when entering a password. I entered it correctly, and hit enter, nothing happened. Then, I had to force shutdown the machine.
So, I decided to give it a whirl on my desktop instead of my laptop. Everything worked perfectly, including encrypted persistence….. So, I tried again on my laptop, and nothing… same problem, cant get past please unlock disk password request. Then I thought, what if i plug in the keyboard from my desktop to my laptop and it worked! But now the touchpad doesn’t work when i plug in the external keyboard.
I’m using a surface book, and I have no idea why this is happening. Again, Thank you
👍
2 things,
first no matter what partition tool I use I can not resize the partition with the image on it.
thinking this was not a huge issue I proceeded to finish per the instructions.
second after rebooting, logging in with persistence, creating a file and rebooting I find the file or any changes at all are not saved.
could my first problem be causing the second? if not what is causing it not to save? I followed every step and got no errors.
Yeah, you’ll need to get your partitions right first.
I would suggest removing all partitions from the USB drive and trying again.
diskpart
and hit enterlist disk
. Soon diskpart will list all the hard drives on your computer, including your USB flash drive that is connecting with the computer. Assuming that your USB flash drive is drive G:to clarify, I did create a second partition but the disk imaging software I was using created a partition for the image the exact size of the image and would not allow me to increase it’s size.
I’ve since used Universal USB Installer as per this guide and was able to make the 4gb partition for kali and partition the remaining space for persistence.
I’ve followed the guide exactly now a few times without error and still nothing is saving.
should this be the only line in persistence.conf
/ union
Yes, it’s just
/ union
. Did you try doing the partitions in MiniTool Partition Wizard?In most cases, this is a partition issue or the wrong commands are entered in part 5 and 6. If you can, copy and paste them and make sure you have the correct device name.
thanks for all the help. yes, the last 6 attempts I used all tools mentioned in this guide. I’ve tried this and other guides over the last 4 days all with no success and I’m still unsure if I keep making a typo and that is causing it to fail. I’ll be trying again with many different USB and microsd in usb adapters and I’ll try doing it without typing 120wpm. I’ll even triple check my spelling of “persistence” as it’s just one of those words I’ll spell wrong 50% of the time. thanks again for the help and writing this guide, it’s by far the easiest to follow and seems to wok great when using the tools described. I’m sure the problem is with me and my spelling and impatient typing. OR could it be I’ve been using a microsd card in a USB adapter? ultimately I NEED kali on a microsd with persistence but I’ll try a standard usb right now.
working now that i’m not using a microsd.
👍
This is the only guide that works.
Tell me about it 😀
setelah saya reboot, saya tidak bisa memasukan passphrase padahal saya sudah membuat mudah passphrase saya
after I reboot, I can’t enter the passphrase even though I have made my passphrase easy
Are there any symbols in your password? Is it case sensitive? Because I suspect it might be a keyboard layout issue. Try a password all lowercase with no symbols next time.
Perfect!
I’ve been through countless guides for setting up encrypted persistence and this has been the only one that worked properly.
Thank you.
🙂
Magnificent guide:)
😉
Worked perfectly! I wasted hours trying to work with kali.org’s now 2 years outdated instructions and was about ready to give up. Even found the suggested software better than what I’d been using.
That’s great to hear. Yes, the reason I made this article is because the official Kali guide is out of date and not very noob-friendly.
I followed each step. ( I’ve done this before with other kali versions and it worked perfectly) . But with the 2018.2 version, at the final step when i boot the live persistence, it’s asking me for the username & password and the default ones, root/toor are not working. I have tried other combinations like user, admin, live but none are working. I keep getting the message “Sorry, that didn’t work. Please try again.”
Can you help me, please?
Not sure why it’s doing that. I will have to download 2018.2 and test this myself.
test it out same problem in Kali 2017.3
and reply on my email
Which Kali Image are you using exactly? Xfce , Light, etc.
works great! thank you!
my problem is…how can i install wifi adapters so i can connect to internet via wifi?
Thanks for the feedback.
Wifi config is beyond the scope of this guide. Try Googling your Wifi adapter name and “Linux”.
This guide is absolutely excellent, worked first time. Highly recommended.
Glad to hear it! 🙂
Followed instructions as posted and everything works with absolutely no problems at all. Nice guide. Thanks
Super! Thanks for the feedback.
Ok so when i get into kali live and try set up persistence, i go through the terminal and do everything up to cryptsetup where i have to enter my own pass it wont allow me to type anything. I’ve rebooted and reran terminal over again and nothing seems to work.
When you type a password in Linux, there are no dots or stars so it looks like nothing is being typed. Just type your password carefully and press enter.
I tried booting into encrypted persistence from a usb after doing the above but now it doesn’t ask me for the passphrase firstly and secondly, after kali linux loads, I cannot interact with the interface at all – cannot click anything.
Please advise
Have you attempted to format the USB Flashdrive again and repeaedt all of these steps?
I’ve tried this tutorial for 2 days but it did not work. and finally today I succeeded by becoming a Root Superuser first with password root/toor. with Kali Linux version 2018.2
OK thanks for the feedback.
Anyone else having this problem with Kali Linux version 2018.2?
meee
HELPPPPPPP!! i m using Kali 2018.2
i did everything u mentioned……
actually i need to use fluxion and this program has to install its dependencies, and when i restart the dependencies go away……. so i have to do that again and again….
one more thing, i havr to copy all my files to the 3.6 GB Volume if i want it back…. if i save it in root, it vanishes after reboot….
plz helppppp
If you create a test folder on the Desktop is it still there after reboot?
P.S. I am using a 8 GB usb……should i use a 16 GB drive….because i am going to use this live usb only for one program (fluxion) which doesnt take many MBs…….
Je vous suis sincèrement reconnaissant pour votre requête c’était vraiment un poids qui s’en est aller .
Soyez abondamment bénis.
De rien. Merci pour vos commentaires.
Persistence works for files but settings still reset because it still is a live install. Is there any way to enable install on a usb like a regular install so that settings are also retained post reboot?
For my 2018.3 even the settings have been stored after reboot. (keyboard and language setting). Did you try the latest release, too?
if it does not work
in Kali GPARTED start and check partition labeling.
Enter “persistence” again
Amarok
Thanks for the tip.
This works on my computer. However, when I boot up on a different computer, it doesn’t recognize my pass code. I get a message saying “No key available for this passphrase”
Do you have any special chars in your passphrase? Your other computer might have a different keyboard layout configured.
So I followed each step carefully but cannot save anything. After every boot I lose all my changes, files etc
This is what my fdisk -l is…
root@kali:~# fdisk -l
Disk /dev/sdb: 7.5 GiB, 8054112256 bytes, 15730688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 8384511 8382464 4G c W95 FAT32 (LBA)
/dev/sdb2 8384512 15730687 7346176 3.5G 83 Linux
Could it possibly be the size of sdb2 since I’ve seen somewhere that you need at least 8GB of free space in the second partition
does that also mean you cant change user from root
No, you unlock the disk with a password only – the Kali username shouldn’t matter.
before you proceed to step 5, you must boot Kali in “Live system (persistence mode)” and not in Live system mode
I don’t see how that makes any difference because you haven’t created
persistence.conf
yet, which this boot option will look for. I’ve tested this several times.works for me, i had troubles with setting up persistence booting in Live system, then i tried booting in persistence mode and continue from step 5, turns out to be the solution for me
i believe this boot option actually enables the possibility of setting up persistence, i have tried it your way twice and it did not work, i went troubleshooting and that’s how i successfully set up persistence, i tested it by creating a map on desktop, rebooting and the map is still there.
Thanks for the feedback 🙂
If anyone else has this issue, could they please let us know in the comments.
Just for info, I also had the same issue. Followed the tut above to the letter, 3 times, result, no persistence.
Followed the above to the letter, with the single exception of booting into live persistence, prior to step 5, and persistence took effect thereafter.
Other than that tiny issue, thanks for the excellent tut
OK, thanks for the feedback. I’ve changed that step now. We’ll see if anyone else has problems.
It is a nice guide but may I ask how can I “full install” Kali to my USB instead of making a persistence for it to use file..? I have search this in Google but all I found is Live or with persistence only…
I’ve never done it before but I’m sure it’s possible.
I think you’ll need two USB drives though, one to load the ISO install, and when you get the the bit about partitions disks (Step 10 here), see if your other USB drive shows up there.
It is not working..I can’t find my usb on the boot menu after the installation…I guess I will have to use the encrypted persistence 🙁
All worked perfectly twice.
Thanks a lot mate.
Cheers from France
De rien!
I can’t believe this worked, such a simple guide. You are simply amazing!
😉
Hello!
Thanks for that!
some info:
If you after 1-3 parts start live on mac and do steps 4-7 you don’t have success. In mac fdisk -l also /dev/sdb2 but doesn’t save changes.
Then I start live on Win computer and do steps 4-7 and then it’s all done! 🙂 and after that it starts normally on mac.
Thanks for the feedback 🙂
Hi! First great guide! Took me a while to get it to work at first, i was installing kali with win32 disk installer. Which created a smaller recovery partition for kali interfering with persistence for some reason. After getting it all sorted out i got the persistence drive working. However when im saving something to the desktop nothing stays after a reboot. I went it to make sure the “” were removed from around the / union. All was well but still cant get things to save outside the persistence drive. When i reboot the persistence drive is remounted, not sure if that changes anything. Hope you can help.
Also to mention i orginally mounted the persistence drive with /dev/sdc2, but i noticed after doing a fdisk -l i see it listed as /dev/sdd2 and my other partition ks /dev/sdd1 (changed from sdb1)
Any reason why are you removing the quotes from
echo "/ union"
?Honestly, i have no idea why im doing it, it was suggested in a couple FAQ’s i found. I’m just following along, I dont really have any experince with linux prior this. Should i put quotes around the / union in the config file?
When I run fdisk-l it shows my usb drive as sdb2 I enter the mount commands reboot to persistence and it’s labled sda2. Hmmm
This worked perfectly! Thank you!
😉
It didn’t work for me either until for step 4 I booted with “live system persistence” instead of “live system” which kept the mount point and persistence.conf file I created in step 5. Now if i create a folder it survives reboots.
Not sure how that makes a difference. In step 4, there’s no point selecting the persistence option because you haven’t set up the persistence partition yet.
Anyway, it worked for you in the end 🙂
on first booting, command crypsetup is not found? why..?
It’s
cryptsetup
– you’re missing a t.Now this is what I call class..Have tried creating the persistence for the past 2 days using all guides there is, all failed untill I found this. Simple and straight forward and works…yeeeeei! Thank you so much. I could have bought you a drink if you were close, but cheers!
Glad it worked 🙂
Does not work
What’s the output for
fdisk -l
?It works! But I used rufus for kali image, and then followed the rest of the steps, dont use disk imager for this task
Thanks for the feedback.
you guys are awesome, after so much searching and testing only yours idea and code, works like a charm…thanks guys.
God bless you.
Great, you’re welcome! God bless.
Two huge thumbs up!!! Spot on.
🙂
Thanks alot, worked perfectly on the first go!
Good to hear!
Failure. Went step by step, smoothly and flawlessly until time for saving. Nada, zero, zip, nothing. thx
What’s the output for
fdisk -l
?Hi, Thanks for the tutorial.
I am getting an error in following command:
mount /dev/sdb2 /mnt/my_usb
Following is the error:
mount: /mnt/my_usb: wrong fs type, bad option, bad superblock on /dev/sbd2, missing codepage or helper program, or other error.
Can you please help me out?
Sounds like the USB wasn’t partitioned properly. Is
sdb2
definitely the USB drive?What’s the output for
fdisk -l /dev/sdb2
?Hello.
First Thanks for the posting this tutorial, secondly ; Can resizing the disk partion 1 makes my left storage (i have 16 gb data traveler usb) unreadble ? Can i undo all tasks such partitionning and resizing and make my usb normal again? i mean if something goes wrong can i get back to the moment which i did not mess with my usb storage ?
Thanks for responding, i am new to partitionning stuff
If you have any important files on the USB drive you must back them up elsewhere because the partitioning and ISO writing will wipe the drive clean.
To restore the USB back to a 16GB drive, you must delete all the partitions you created in Partition Wizard and then create a new 16GB FAT32 partition in the unallocated space.
Thank you very much! Perfect instructions.
Work like a charm.
You’re welcome. Happy cracking!
Hi.
I´ve followed the guide exactly, but this still dosent work for me. I also tried it in ext3.
When im creating a “Test” folder and reboot, it dosent work, the folder has been deleted.
So what to do now?
Hi there. I’ve gone through this guide again from scratch using a Sandisk 16GB USB drive and it worked fine for me. What is your output when running
fdisk -l
?It´s now working just fine. The issue semed to be with my USB drive. Apperently it wasnt formated and prepared correctly.
I did that and followed the guide exactly, and now its working just fine.
Thx m8 😉
Great!
im sure i followed the exact same steps, same commands but still no persistence.
Good guide, very easy to follow but no persistence for me 🙁
Hi there. Well, I’ve gone through this guide again from scratch using a Sandisk 16GB USB drive and it worked fine for me. What is your output when running
fdisk -l
?Same here.
Same with me
Im 100% sure i followed to exact instruction but it doesnt work.
When i create an empty folder, after reboot ia not there.
Good tutorial, explicit and easy to follow but for me it doesnt work
What is your output when running
fdisk -l
?k1tweeked:
OUTPUT FOR
fdisk -l /dev/sdb2
My USB is not a Sandisk and it’s 32g. HP Thin Client Pro T520 clean install Boot Nuke, Kali lite. Where did i go wrong? BTW same sentiments as above, good tutorial , easy to follow, or at least i thought it was…
It might be this:
sdb1
is formatted as NTFS whereas it should be FAT32. Look at Step 1, did you check the right file system in Universal USB Installer? I haven’t tested this guide with NTFS, not sure if it makes a difference.ps. I’ll download Kali Lite today and run through the guide again in case there are any issues.
When I enter your second command,
/dev/sdc2 /mnt/my_usb
It gives me the following readout
Bash: /dev/sdc2: permission denied
Please help.
Try running it with
sudo
I have a multi-boot external hard drive, with kali-2017.2 and a luks encrypted persistence drive. I just added kali-2018.1 to the bootloader and want to know how I reformat the drive to work with kali-2018?
really, really the most thorough and complete instructions I’ve found. My usb was a 32gb so I created 2- 4gb partitions (boot and persistence), then formatted the remaining space with NTFS and labeled it storage.. Naturally i won’t read that storage partition in windows, but that’s all right. Thanks again
Glad it helped 🙂
After having difficulties with the official documentation that seems to be outdated concerning actual Kali Linux 2018 distribution this solution worked fine for me. Thanks a lot!
I would still be interested in a solution for Linux tools, especially openSUSE’s partitioner (seems to be different from gparted), alternatively with Knoppix.? Had some issues with this.
Thanks for the feedback. Yes, a guide for Linux is on the list of things to do.
Followed guide to the letter however when I try to apply changes in MiniTool I get “Invalid configuration file”
Any comment appreciated
What USB drive are you using? You may need to format it using the manufacturer’s recommend tools. Also make sure another application isn’t using it.
For me , the persistant partition was mounted in an other place by default so i had to unmount it and then do the rest of the tuto
This process works with Kali 2018 as well
There is an updated guide for Kali 2018 available now.
Persistence
Hi. i did all steps but unfortunately did not work. After reboot everything disappear.
What is your output when running
fdisk -l
?Can I use ext3?
Yes, you can!
I found with system Ext3 would work most 2 boots and then total mess. Ext4 not a single problem and that’s all I changed was the Ext.
This issue has as many answers as there are USB drives maddingly attempting persistent storage. Thank you for providing clear, succinct and accurate instructions! Now if you could only address the LUKS encryption I would be set.
Hi. Did you try this guide for LUKS encryption?
worked perfectly. thanks. and it’s ext4.
That’s great. Thanks John.
After surfing dozens of sites, I finally found a perfect guide for USB live persistence with encryption. Thanks! really helped a lot.
Great!
aye, great tutorial bro but i got an error when i try to running “cryptsetup –verbose –verify-passphrase luksFormat /dev/sdb2” command which give me “cannot format device /dev/sdb2 which is still in use” how to solve this? thank you in advance.
It shouldn’t be in use at all. Are you sure
sdb2
is the correct device?using the sudo command worked for me
When i finish the process and boot from the usb it ask me to unlock a difirente partition (mint linux encrypted), any tips?
Hmm, not sure. I haven’t tested this on anything other than Kali.
that’s a great tutorial. However as soon as you you do an update terminal stops working and kali is buggy. Anyway to fix this?
What command did you enter when it went buggy?
Didn’t worked, had to make the partition ext3.
I’ve just followed this guide again using a brand new 16GB SanDisk Ultra USB drive and EXT4 worked fine for me.
Did you follow this guide exactly? Did you write using Universal USB Installer and set up partitions using MiniTool? Are you using 32bit or 64bit Kali? What USB drive is it?
Thanks it worked for me first time. In the previous guide (non-encryption) you format the persistence partition with EXT4 in Windows but in this guide you format with EXT3 in Ubuntu. Is there any reason for that? Thanks.
The official Kali guide says to use EXT3 but I think they haven’t updated the guide in a while. I haven’t tested with EXT4 yet but I don’t see why it wouldn’t work.
Tested with ext4 and appears to work without any issues.
Great, thanks.