I have got WSL2 installed. When I boot ubuntu in the terminal, it's default starting directory is %USERPROFILE%, what should I do to set the ubuntu root directory as the starting directory,I've tried to set it to '/' ,but not help.

This is a dupe of so very many issues, please search before filing. startingDirectory needs to be a Windows path. I'd recommend setting it to //wsl$/Ubuntu/home/username
Most helpful comment
This is a dupe of so very many issues, please search before filing.
startingDirectoryneeds to be a Windows path. I'd recommend setting it to//wsl$/Ubuntu/home/username