The Ubuntu terminal may throw out an error – Failed to fork on Windows v. This terminal gets installed under the feature of Windows Subsystem for Linux. The cause of this error comes down to be lack of memory and can occur when a user is trying to get the latest updates for the terminal. The error reads:
# apt-get update
FATAL -> Failed to fork.
Fatal, Failed to Fork error with Ubuntu on Windows 11/10
If you receive Failed to Fork error with Ubuntu on Windows 11/10, we suggest you try our following suggestions:
- Create a new Swap file.
- Disable the Antivirus.
1] Create a new Swap file
Open the Terminal for the Windows Subsystem for Linux distro and enter the following command to create a new swap file and allocate 4 Gigabytes to it:
sudo fallocate -1 4G /swapfile
Make the file more secure by entering this command:
sudo chmod 600 /swapfile
Set the swap space with this command:
sudo mkswap /swapfile
Next, enable the swap space with this command:
sudo swapon /swapfile
Reboot your computer after closing the distro and check. Your error should be fixed.
2] Disable the Antivirus
Your antivirus might be affecting the proper functioning of the activities in the WSL Terminal. We recommend you to temporarily turn the Antivirus solution or Windows Defender off and check if that fixes the error.
Turn it on after the operation completes successfully.
We hope you found the steps easy to follow and that you were successful in resolving the issue.