Wsl distro Installation issue:

I was able to run wsl --install and go through the installation process. That went pretty smooth. After installing I restarted my computer. And this is where I'm stuck. I have ran wsl --install -d in windows powershell. What I get back in "the requested operation requires elevation" guessing I need to run it as admin. But when I do, I get this message: No actions was taken as a system reboot is required. I had restarted my computer 2 more times afterwards and it's still the same. I'm lost now. I tried looking for answers on GitHub before coming here.
37 Replies
ἔρως
ἔρως‒7d ago
you have to actually reboot the pc as in, a reboot, not turn off and then on or disable fast boot on windows also, make sure you have virtualization enabled on the bios
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
Alright. I'll figure out how to do that. Didn't know restarting and rebooting was to different things
ἔρως
ἔρως‒7d ago
well, it depends if you mean a restart as "shutdown and turn on", it isn't the same as a reboot if windows fast boot is enabled from my understanding, fast boot saves the kernel and hardware configurations (and drivers) in the hybernation file, so it doesn't have to re-configure the hardware everytime it boots now, you added components to windows, so, the kernel needs to re-initialize a reboot - using the "restart" option in the start menu, will do that re-initialization a shutdown and turning on will keep reading from the saved stuff in the hybernation file
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
Yeah I did do the "restart" option. Both times. So the shut down and turn on is basically close the laptop, open it?
ἔρως
ἔρως‒7d ago
no, it isn't that suspends the laptop, but may or may not write to the hybernation file as well, in case the battery dies
dys πŸ™
dys πŸ™β€’6d ago
I'll second this. Not having hypervisor running can cause lots of weird errors. From the FAQ:
Run β€œbcdedit /enum | findstr -i hypervisorlaunchtype” in an elevated PowerShell & if you see hypervisorlaunchtype Off, run β€œbcdedit /set hypervisorlaunchtype Auto” & then β€œRestart-Computer” (also in PowerShell).
ἔρως
ἔρως‒6d ago
the easiest way to see how to enable it is via google
ἔρως
ἔρως‒6d ago
what was it? what fixed the issue?
ἔρως
ἔρως‒6d ago
that can cause it too
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
Then I ran the command wsl --install --d Ubuntu. Worked perfectly
ἔρως
ἔρως‒6d ago
you dont need to specify ubuntu, as it is the default
dys πŸ™
dys πŸ™β€’6d ago
As you're beginning to program, I recommend knowing the code . command typed in the terminal. I use it pretty much every day. This will open the directory you're currently in in VS code. (In *nix, . means β€œthe current directory” & .. means β€œthe parent directory”.)
ἔρως
ἔρως‒6d ago
that means the same on windows but you can just open vscode from vscode using the remote extension
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
Yup! I love this feature. Did that on my Chromebook before vs code started to become unstable 😭
ἔρως
ἔρως‒6d ago
no need to install or anything
ἔρως
ἔρως‒6d ago
it is amazing
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
I hate asking for help for a third time but I can't figure this out. Shits going smoothly. I ran code . to open vc code. But when it comes time to adding files or folders, I don't have permission.. what's going on there? Figured it out! Solution: So by default, for me at least, root had ownership. Me, being a user, I'm 1 or 2 steps below root therefore I didn't have permission. I found this out by running ls -l which brought up some information for the files and folders. For me, it came back as drwxr-xr-x 2 root root 4096. What I needed to do was change "root root" into my username. sudo chown -R your_username:yourusername directory. (User:group). This is for anyone else who might have the same issue
ἔρως
ἔρως‒5d ago
you actually should also do sudo chmod -R 0777 ./dir or use find to do it this is because root may need access to it, besides your user and www-data (depending on the project)
Jochem
Jochemβ€’5d ago
root should still have access regardless of access rights, though www-data could be an issue in the future... but only if you actually use apache or nginx to serve anything, which is unlikely to ever happen on WSL. also changing everything to 777 is bad practice, even if it works. Filesystem permissions should be as restrictive as possible, and files should never have the executable flag set unnecessarily it doesn't matter as much on WSL tbh, cause it's just going to be accessible on your own PC, so I'm just adding this as general info about best practices
ἔρως
ἔρως‒5d ago
i agree with you 0644 for files and 0755 for folder (or the opposite) is whats usually used i know it is bad, but, i just nuke it all to 0777 as i really need it to be accessible to those 3 users
Jochem
Jochemβ€’5d ago
oh, same, just don't do it on a production server. I mean, first thing I do installing windows is turn UAC off
ἔρως
ἔρως‒5d ago
OH, no! not in production! specially in a shared environment
πš†πš˜πš•πšπš’πšŽπŸ”₯πšŽπš•πš’πšπšŽ
Do I change dir to a specific director or type it as is?
ἔρως
ἔρως‒5d ago
do you need that command?
ἔρως
ἔρως‒5d ago
it changes the permissions of all files and folders to allow all users to do anything in all files inside the folder
ἔρως
ἔρως‒5d ago
i do it, but i know what im doing
ἔρως
ἔρως‒5d ago
i know, and i do it for my situations just dont do this in production
ἔρως
ἔρως‒5d ago
if it is working the way you need, dont do it
ἔρως
ἔρως‒5d ago
you're welcome

Did you find this page helpful?