You are running the command in TemplateVM? It has no access to internet so this import will not work.
- You could enable internet access for this template but it is not advised.
- You can use snap to install code but I find it unreliable and snaps can brake in time. guide
- I use flatpak to install code. Plus of this solution is that you can limit access that code have to your VM. And VS code is known for spying on its users.
On minus side is that you have to manually run
flatpak update on AppVM.
if you decide to use flatpak here are the commands:
# Template VM
sudo dnf install flatpak
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists --user fedora oci+https://registry.fedoraproject.org
flatpak install --user -y flathub com.github.tchx84.Flatseal
flatpak install --user -y flathub com.visualstudio.code
Flatseal is not required but I recommend to use it to tighten flatpak security.