I searched everywhere for this one and really found little in the way of a definitive answer. After some testing, I was able to determine that copying the config.txt from a Raspbian image did work for Kali Linux.
Adding or editing your config.txt on PC
Insert the flashed micro SD card into your PC and you can access the boot directory as the root directory of the sd card.
Adding or editing your config.txt on Kali Linux
The /boot partition isn’t mounted by default (you will be able to navigate to it but there will be no content) so you will need to mount it before you can access it. The system defaults the this partition to /boot when mounted.
mount /dev/mmcblk0p1
You can navigate to /boot to confirm that mmcblk0p1 has been mounted. You will see files if this was successful. Then you will make your config.txt here. File permissions are set automatically if the file is created in /boot.
cd /boot
nano config.txt
Insert the following stock config.txt content into your config.txt file. This was pulled from most recent, at the time of writing this, Raspbian image.
# For more options and information see # http://www.raspberrypi.org/documentation/configuration/config-txt.md # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display is not detected and composite is being output #hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) #hdmi_group=1 #hdmi_mode=1 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800 # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable the lirc-rpi module #dtoverlay=lirc-rpi # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on
Save the file and reboot. Kali Linux will automatically load the config.txt on startup.
Conclusion
I spent a few hours looking for this information and found example after example that had me installing things to read the config.txt, locations of the config.txt that didn’t exist and complex directions that didn’t work.
One consistent thing I saw was the suggestion to just make it, add your changes and give it a try to see if it works. I did this to install an lcd hat and I can confirm that adding my settings to the config.txt and completing the steps above worked for me.
Let me know if you have any questions or share your success in the comments below.
Thanks.. this helped me a lot. I was initially confused as it seemed /boot/ was mounted (but blank). Turns out I did need to mount /dev/mmcblk0p1 and then this worked.
Many thanks!
So glad to hear that it helped you out. I ran into the same issue the first time I tried this too. I noticed that it varies from disto to distro.
Thanks for stopping by!
how did you “access the boot directory as the root directory of the sd card.” I can’t seem to change the config text after I change the sd card after I install kali linux
On my Windows 10 PC when I insert the micro sd I see two drives mount, F and G. One shows up as a drive that needs formatted (it’s the Linux partition) and one shows the contents of the boot partition.
When you insert your Micro SD into the PC are you able to see two drive letters mount?
Actually J, I just tried this again on a recent install of Kali and am not seeing the config.txt file any longer on the mounted drive. This may have changed in a more recent release. You will have to update it with the Linux steps outlaid above.
I will see if it’s still possible in any way to access it via Windows 10.
Thanks J!
J, one more update. I can confirm that the drive letter that mounts when you insert your sd card via Windows (10 at least) is the boot directory. You can create the config.txt file in this root directory which does translate to the boot directory when the SD card is put back in the PI.
Hope this helps!
This absolutely worked for me!
I had a hunch the config.txt wasn’t being loaded, but I didn’t think /boot wasn’t accessible to the OS, so as soon as I read your content I knew immediately it was my problem.
This will solve this problem for so many people!
Thanks so much!
P.S. Another topic there is a bluetooth issue as well, have you figured that issue out?
Hi Cyb3rP1, I’m so glad to hear that this worked for you. I’ll look into the bluetooth issue next!
This was awesome, 2-3 questions… would this possibly fix mate sound issues on pi/Armbian sound issues on tinkerboard and may I share this article via my site and credit you for the solution?
Hi AlwaysInTao. Thanks for the comment! I’m glad you found it useful. I would have to recommend giving it a try on Mate and Armbian as I’ve not tested. Feel free to share and I appreciate the credit.
Pingback: Raspberry Pi Fixing Sound On Kali Linux – AlwaysInTao
Thank you!!!
Thank you!
Worked great.
/dev/mmcblk0p1 was already mounted.
It works.
I also used this guide with nano:
https://askubuntu.com/questions/54221/how-to-edit-files-in-a-terminal-with-nano
It ain’t workin for me.I am on Raspberry pi 3 model b.
Sorry for the delay in comment. Your message was lost in a pile of spam. If you want to elaborate, I’d be happy to look into it for you. What did you try? Can you send any screenshots?
Thanks!
Sorry this reply took so long, it was buried in spam. Thanks for sharing this guide, I’ll have to make one in a future post!
Hi! Thanks for the help, but it didn’t works.
I edited config.txt, add those lines and reboot but kali keeps without sound. Can you help me? please!!!!
Worked flawlessly! Excellent patch.
Hi
I tried your tutorial but ran into touble:
~# mount /dev/mmcblk0p1
mount: /dev/mmcblk0p1: can’t find in /etc/fstab.
Any thoughts? Using Latest Kali Linux on Raspberry pi 4
Hi! Thanks for the guide. It didn’t work for me. Raspberry Pi 3 b+. Is this up to date?
Hi! Clear guide, good job. It doesn’t work for me.