I had the same problem described here, new install of Ubuntu 18.04 LTS. I installed VS Code from conda.
Discovered that if you run the following
code --verbose
It will tell you what is going on with Code. In my case
code --verbose
[main 20:19:26] Startup error:
Error: EACCES: permission denied, mkdir '/home/<user>/.config/Code/CachedData'
sure enough the folder ~/.config/Code had root access permissions for some reason. Deleted the folder using sudo.
rm -rf /home/<user>/.config/Code
Tried again to run code and it working fine.
Answer from Robin G on askubuntu.comI had the same problem described here, new install of Ubuntu 18.04 LTS. I installed VS Code from conda.
Discovered that if you run the following
code --verbose
It will tell you what is going on with Code. In my case
code --verbose
[main 20:19:26] Startup error:
Error: EACCES: permission denied, mkdir '/home/<user>/.config/Code/CachedData'
sure enough the folder ~/.config/Code had root access permissions for some reason. Deleted the folder using sudo.
rm -rf /home/<user>/.config/Code
Tried again to run code and it working fine.
I had the same problem. Like Robin G and Nezir suggested I realized that the owner of the /home/user/.config/Code directory is the "root". However, You could just change the ownership of that directory instead of removing it.
sudo chown -R $USER "$HOME/.config/Code"
"-R" option is needed to recursively change the ownership of all the files and directories under the target directory.
After this the Visual Studio Code v. 1.27 on Ubuntu 18.04 works as it is supposed to on my machine.
VS Code Not Opening Properly in Ubuntu 20.04.6 LTS
VS Code not opening in Ubuntu 20.04
Visual Studio Code can't run in Ubuntu 18.04 - Stack Overflow
VS Code not responding on launching
Videos
Command:
code --in-process-gpu .
Note:
The above command works for me. The option --in-process-gpu is the crux in the above command.
Reference:
https://github.com/microsoft/vscode/issues/212494#issuecomment-2151807211
https://github.com/microsoft/vscode/issues/212494#issuecomment-2151817989
Chromium Switches For Further Study:
https://peter.sh/experiments/chromium-command-line-switches/
Remove the snap then
sudo snap install --revision 159 --classic code
https://github.com/microsoft/vscode/issues/204159#issuecomment-2151526680
OR
No need to reinstall or downgrade
code --in-process-gpu
https://github.com/microsoft/vscode/issues/212494#issuecomment-2152653486
https://github.com/microsoft/vscode/issues/212494#issuecomment-2151823774
May 2024 release of VSCode is breaking on Ubuntu 24.04, 23.10
After restoring my Ubuntu to a version from 10 days ago using Timeshift due to errors encountered while installing Wine, I've noticed that the App Center won't open. Additionally, whenever I attempt to open VS Code, the window briefly appears before closing itself. I've tried updating the software to the latest version using commands, but none of these solutions seem to work. What steps can I take to resolve these issues?
I found the solution by uninstalling the VScode from Snapstore. Then download the .deb vscode package from the official site and install it. The problem might be mixing the .snap package installation with the .deb package.
A temporary solution is to revert the VSCode to its previous version until the support team fixes it. Try to run this from your terminal:
sudo snap revert code
When i try to start vscode, it immediately crashes. This happened very randomly, because vscode ran perfectly this morning. When i run code --verbose, i get the following:
[0202/171254.100324:ERROR:file_io_posix.cc(152)] open /home/robbe/.config/Code/Crashpad/pending/68255db5-6e73-4d8d-9375-7f91faf6649b.lock: File exists (17)
[0202/171254.112832:ERROR:directory_reader_posix.cc(42)] opendir /home/robbe/.config/Code/Crashpad/attachments/f1312132-278c-479a-b99c-0cdf0cb5c4e6: No such file or directory (2)
[7040:0202/171254.257319:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[main 2024-02-02T16:12:54.528Z] [File Watcher (node.js)] Request to start watching: /home/robbe/.config/Code/User (excludes: <none>, includes: <all>, correlationId: <none>),/home/robbe/.config/Code/User/settings.json (excludes: <none>, includes: <all>, correlationId: <none>)
[main 2024-02-02T16:12:54.559Z] Starting VS Code
[main 2024-02-02T16:12:54.559Z] from: /usr/share/code/resources/app
[main 2024-02-02T16:12:54.560Z] args: {
_: [],
diff: false,
merge: false,
add: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
help: false,
'list-extensions': false,
'show-versions': false,
'pre-release': false,
'update-extensions': false,
version: false,
verbose: true,
status: false,
'prof-startup': false,
'no-cached-data': false,
'prof-v8-extensions': false,
'disable-extensions': false,
'disable-gpu': false,
'disable-chromium-sandbox': false,
sandbox: false,
telemetry: false,
debugRenderer: false,
'enable-smoke-test-driver': false,
logExtensionHostCommunication: false,
'skip-release-notes': false,
'skip-welcome': false,
'disable-telemetry': false,
'disable-updates': false,
'use-inmemory-secretstorage': false,
'disable-workspace-trust': false,
'disable-crash-reporter': false,
'crash-reporter-id': '83c17b02-ab04-4ea6-a5e8-df0b3ffbebcd',
'skip-add-to-recently-opened': false,
'unity-launch': false,
'open-url': false,
'file-write': false,
'file-chmod': false,
force: false,
'do-not-sync': false,
trace: false,
'preserve-env': false,
'force-user-env': false,
'force-disable-user-env': false,
'open-devtools': false,
'disable-gpu-sandbox': false,
'__enable-file-policy': false,
'enable-coi': false,
'no-proxy-server': false,
'no-sandbox': false,
nolazy: false,
'force-renderer-accessibility': false,
'ignore-certificate-errors': false,
'allow-insecure-localhost': false,
'disable-dev-shm-usage': false,
'profile-temp': false,
logsPath: '/home/robbe/.config/Code/logs/20240202T171254'
}
[main 2024-02-02T16:12:54.560Z] Resolving machine identifier...
[main 2024-02-02T16:12:54.561Z] Resolved machine identifier: 019f2735ec081d26def35c5da14b879459931ba323faa0546ab0d6444d034249
[main 2024-02-02T16:12:54.562Z] Main->SharedProcess#connect
[main 2024-02-02T16:12:54.570Z] [File Watcher (node.js)] Started watching: '/home/robbe/.config/Code/User'
[main 2024-02-02T16:12:54.573Z] [File Watcher (node.js)] Error: ENOENT: no such file or directory, stat '/home/robbe/.config/Code/User/settings.json'
[main 2024-02-02T16:12:54.574Z] StorageMainService: creating application storage
[main 2024-02-02T16:12:54.583Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2024-02-02T16:12:54.584Z] lifecycle (main): phase changed (value: 2)
[main 2024-02-02T16:12:54.585Z] windowsManager#open
[main 2024-02-02T16:12:54.588Z] windowsManager#open pathsToOpen [
{
workspace: { id: 'dbed13c5ea969539b8d31aa62428aeab', uri: [$] },
type: 2,
exists: true
}
]
[main 2024-02-02T16:12:54.590Z] windowsManager#doOpenFolderOrWorkspace {
folderOrWorkspace: {
workspace: { id: 'dbed13c5ea969539b8d31aa62428aeab', uri: [$] },
type: 2,
exists: true
},
filesToOpen: undefined
}
[main 2024-02-02T16:12:54.593Z] IPC Object URL: Registered new channel vscode:0a7247db-3973-419f-a60f-25d8fbcc910e.
[main 2024-02-02T16:12:54.593Z] window#validateWindowState: validating window state on 1 display(s) { mode: 1, x: 256, y: 91, width: 1024, height: 773 }
[main 2024-02-02T16:12:54.594Z] window#validateWindowState: 1 monitor working area { x: 0, y: 27, width: 1536, height: 837 }
[main 2024-02-02T16:12:54.594Z] window#ctor: using window state { mode: 1, x: 256, y: 91, width: 1024, height: 773 }
[main 2024-02-02T16:12:54.677Z] window#load: attempt to load window (id: 1)
[main 2024-02-02T16:12:54.687Z] StorageMainService: creating workspace storage (dbed13c5ea969539b8d31aa62428aeab)
[main 2024-02-02T16:12:54.689Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 1, emptyToRestore: 0, emptyToOpen: 0)
[main 2024-02-02T16:12:54.689Z] lifecycle (main): phase changed (value: 3)
[main 2024-02-02T16:12:54.690Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2024-02-02T16:12:54.691Z] update#setState idle
[7040:0202/171254.702002:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171254.702028:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 1 time(s)
[7040:0202/171255.060917:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171255.060944:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 2 time(s)
[7040:0202/171255.394779:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171255.394804:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 3 time(s)
[7040:0202/171255.678511:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171255.678530:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 4 time(s)
[7040:0202/171255.955641:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171255.955661:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 5 time(s)
[7040:0202/171256.222016:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171256.222034:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 6 time(s)
[main 2024-02-02T16:12:56.255Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[7040:0202/171256.415997:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171256.416021:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 7 time(s)
[7040:0202/171256.598384:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171256.598408:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 8 time(s)
[7040:0202/171256.789231:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=133
[7040:0202/171256.789247:WARNING:gpu_process_host.cc(1364)] The GPU process has crashed 9 time(s)
[7040:0202/171256.789259:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.
[0202/171256.798958:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Does anyone have an idea how i can fix this? I have reinstalled code several times, cleared the config/Code directory and also cleared the .vscode directory. Starting it with --disable-gpu also does not change anything :( Any help is appreciated
I had the same issue today. I was able to revert to a previous version of the snap and it started normally.
$ snap list code --all
Name Version Rev Tracking Publisher Notes
code dc96b837 159 latest/stable vscode✓
disabled,classic
code 89de5a8d 160 latest/stable vscode✓ classic
So I reverted to the most recent version.
$ sudo snap revert --revision=159 code
or simply
$ sudo snap revert code
I don't want to use the .deb version so this is an alternative for those who wish to stay on snap.
I faced this issue today on my Ubuntu 24.04 and thought it might be a bug. After several restarts and updates, I realized it was bugging in the Snap Store version. So I downloaded the .deb package from their Official Downloads. Then I used apt to install the package.
sudo apt install ./code_1.90.0-1717531825_amd64.deb
Now my Visual Studio Code is working fine with all my previous data on the latest version.
If you want to use the previous Snap version instead of .deb package, you can use this command:
$ sudo snap revert code