I recently installed virt-manager on Arch Linux, and unlike under Ubuntu, I was not prompted to choose a text editor on the first launch of virsh-edit. Instead, the XML file was opened in vi (or vim, not sure).
From this thread in the RedHat archives, I thought that if I just added to ~/.bashrc
:
export EDITOR=/usr/bin/nano
that would solve the problem. But setting EDITOR environment variable didn't work.
Also, launching it with EDITOR=geany sudo virsh edit myWINVM
gave the same result, as did trying to use a different editor: EDITOR=geany sudo virsh edit myWINVM
as described here
and I see that the variable has in fact been set:
[~]$ printenv
SHELL=/bin/bash
SESSION_MANAGER=local/virtland:@/tmp/.ICE-unix/5451,unix/virtland:/tmp/.ICE-unix/5451
WINDOWID=27262979
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg
XDG_MENU_PREFIX=xfce-
SSH_AUTH_SOCK=/tmp/ssh-j36TZui4fOt5/agent.5457
DESKTOP_SESSION=Xfce Session
SSH_AGENT_PID=5458
EDITOR=/usr/bin/nano
...
However virsh edit MYVM
still opens the XML in vi.
Is there something different I need to do in Arch? Has the method of changing this setting been changed in recent updates of virsh?
/bin/nano
. – Freddy Feb 24 '19 at 13:08/usr/bin/nano
opens nano. I also have it at /bin/nano. Both paths have the same effect. – Stonecraft Feb 24 '19 at 13:12VISUAL
instead? See How can I set "vi" as my default editor in UNIX? and VISUAL vs. EDITOR – what’s the difference? – Roman Riabenko Feb 13 '22 at 09:02