You are not logged in.
Hi
I share my Nvidia GPU with a windows VM. I do that by disabling the display and converting my computer to a headless machine. Then passing through the GPU to the VM.
When I am done with the VM I restart the Display. I get gdm and gnome shell back.
The issues that I am having is that I lost the login (getty) on VT2 though VT7
So how do I restart the login terminal on VT2 though VT7.
I tried to use the getty@ service. That did not work.
Offline
I do that by disabling the display
Please post the exact command(s) used.
I restart the Display.
Please post the exact command(s) used.
I tried to use the getty@ service.
Please post the exact command(s) used.
That did not work.
Offline
I disabling the display:
#!/bin/bash
# Stop display manager
systemctl stop display-manager.service
killall gdm-x-session
# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI-Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
sleep 2
# Unbind the GPU from display driver
/usr/sbin/rmmod nvidia_drm
/usr/sbin/rmmod nvidia_modeset
this was takedn and modified from https://github.com/joeknock90/Single-GPU-Passthrough
sleep 1
virsh nodedev-detach pci_0000_0f_00_0
virsh nodedev-detach pci_0000_0f_00_1
Restarting the DIsplay :
#!/bin/bash
# Re-Bind GPU to Nvidia Driver
virsh nodedev-reattach pci_0000_0f_00_1
virsh nodedev-reattach pci_0000_0f_00_0
# Reload nvidia modules
modprobe nvidia
modprobe nvidia_modeset
modprobe nvidia_uvm
modprobe nvidia_drm
# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
# Some machines might have more than 1 virtual console. Add a line for each corresponding VTConsole
#echo 1 > /sys/class/vtconsole/vtcon1/bind
nvidia-xconfig --query-gpu-info > /dev/null 2>&1
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# Restart Display Manager
systemctl start display-manager.service
This was taken and modified from: https://github.com/joeknock90/Single-GPU-Passthrough
Offline
I can start the VT manually for example:
sudo systemctl start getty@tty3.service
Why not all of them are restarting automatically.
Offline
Check the journal to see what's happening with the various getty@tty?.services.
This is just a shot in the dark but try replacing
systemctl stop display-manager.service
killall gdm-x-session
With
systemctl isolate multi-user.target
And replace
systemctl start display-manager.service
With
systemctl isolate graphical.target
Offline
There are no messages in journalctl regarding tty2-tty7
also "systemctl isolate multi-user.target" did not stop the display manager. Thus I wasn't able to passthrough the GPU
It is not clear to me how during boot the tty2-6 (or 7) are started.
if it is any of these units then why running them when restarting the display does not restore the terminals.
/usr/lib/systemd/system/console-getty.service
/usr/lib/systemd/system/container-getty@.service
/usr/lib/systemd/system/getty-pre.target
/usr/lib/systemd/system/getty@.service
/usr/lib/systemd/system/getty.target
/usr/lib/systemd/system/serial-getty@.service
Offline
http://0pointer.de/blog/projects/serial-console.html
n a systemd world we made this more dynamic: in order to make things more efficient login prompts are now started on demand only. As you switch to the VTs the getty service is instantiated to getty@tty2.service, getty@tty5.service and so on.
Since the autospawning is configured in logind.conf, I'd try "systemctl restart systemd-logind.service" (but idk whether that will suffice)
Offline
http://0pointer.de/blog/projects/serial-console.html
Since the autospawning is configured in logind.conf, I'd try "systemctl restart systemd-logind.service" (but idk whether that will suffice)
That did not work. It actually caused a system freeze.
Offline
"systemctl isolate multi-user.target" did not stop the display manager
Hmm, sorry. It always worked for me when I was using GNOME & GDM.
It is not clear to me how during boot the tty2-6 (or 7) are started
See systemd-getty-generator(8).
Another guess: try reloading the frame buffer with
# udevadm trigger /dev/fb*
Offline
This is did not fix the issue. there is something, which is done during boot differently from what I am going now. Is there a way to restore the display/getty serviced to their state in the early boot and then redo the boot portion related to the displays/getty services. Many years ago before systemd. It was possible to go to a system state with very basic graphics (getty without X11). I do not know if it is possible with systemd.
Changing display state is important when there is a need to switch to a headless state and back.
Offline
This brings the TTYs back for me after I stop them manually:
# systemctl restart getty.target
Offline
That did not work either.
Offline