vscode without distrobox

basically torch.compile doesn't work in distrobox even if I select non-distrobox python and i tested multiple distrobox distros and it always happens, so i need to install vscode outside of distrobox so is it possible to install non distrobox vscode and have it actually see my file system and conda environments unlike the flatpak version
9 Replies
wolfyreload
wolfyreload2mo ago
You can layer it with rpm-ostree if you like. I've adjusted the instructions from here https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions Add an entry into "/etc/yum.repos.d/vscode.repo"
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
Then don't install with dnf, use rpm-ostree instead
rpm-ostree install code
rpm-ostree install code
Reboot your machine and you'll have vscode installed as if it was part of the image. The downside is your updates will be a little slower as it will need to download the latest vscode whenever you do updates. So don't go crazy with layering lots of software.
Visual Studio Code on Linux
Get Visual Studio Code up and running on Linux.
Emiliopg_91
Emiliopg_912mo ago
why not any AppImage distribution? is the way io work, self updatable and without layering
xiao
xiao2mo ago
you can just use tar.gz version downloaded from offcial site
1
1OP2mo ago
Would that still require layering?
xiao
xiao2mo ago
no. You can put it in your home home directory and create a desktop entry
1
1OP2mo ago
oh thats nice, thanks, because I red somewhere that layering makes the system slow, and maybe it is wrong but I would get FOMO from doing it so I can't wait it works like exe file that crazy If anyone has this issue, here is how I fixed it so I created a file called .VSCode in /home/jj/.local/share/applications and then copied this from google:
[Desktop Entry]
Name=VScode
Comment=Code Editing. Redefined.
NoDisplay=false
GenericName=Text Editor (on ubuntu)
Exec=/var/home/jj/VSCode/code
Icon=/var/home/jj/VSCode/resources/app/resources/linux/code.png
Type=Application
StartupNotify=false
StartupWMClass=code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Keywords=vscode;
[Desktop Entry]
Name=VScode
Comment=Code Editing. Redefined.
NoDisplay=false
GenericName=Text Editor (on ubuntu)
Exec=/var/home/jj/VSCode/code
Icon=/var/home/jj/VSCode/resources/app/resources/linux/code.png
Type=Application
StartupNotify=false
StartupWMClass=code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Keywords=vscode;
and then rebooted and it works now okay so I am having an issue, I am trying to log into my VSCode account, which opens my browser, but then in my browser when it is supposed to redirect me back to VSCode, I can only choose the distrobox VSCode
xiao
xiao2mo ago
change Exec in desktop entry of distrobox VSCode to Exec=/var/home/jj/VSCode/code
1
1OP2mo ago
thanks it worked I created VSCode-url-handler.desktop in /home/jj/.local/share/applications and copied this into it from fedora one and changed the path
[Desktop Entry]
Name=VSCode - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/var/home/jj/VSCode/code --open-url %U
Icon=/var/home/jj/VSCode/resources/app/resources/linux/code.png
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/vscode;
Keywords=vscode;
StartupWMClass=code
[Desktop Entry]
Name=VSCode - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/var/home/jj/VSCode/code --open-url %U
Icon=/var/home/jj/VSCode/resources/app/resources/linux/code.png
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/vscode;
Keywords=vscode;
StartupWMClass=code
I also opened /home/jj/.local/share/applications/mimeinfo.cache and added the new VSCode-url-handler.desktop to it:
x-scheme-handler/vscode=fedora-code-url-handler.desktop;ubuntu-code-url-handler.desktop;VSCode-url-handler.desktop;
x-scheme-handler/vscode=fedora-code-url-handler.desktop;ubuntu-code-url-handler.desktop;VSCode-url-handler.desktop;
and then it worked after reboot
asen23
asen232mo ago
layering wont make your system slow, it only slow the system update and introduce possible deps issue (really small unless you start to layer everything), i was dailying with vscode + docker + and few other layered and doesnt have any problem also you wont even notice the system update if you are in desktop because it is automatically happened in the background anyway

Did you find this page helpful?