@@ -7,33 +7,34 @@ layout: vm-operator
77
88* Since 4.0.0*
99
10- When a user logs in on the web GUI, he has already authenticated with the
11- VM-Operator. Depending on the environment, it may be tedious to log in again
12- on the guest. The VM-Operator therefore supports automatic login on the guest
13- operating system which can streamline the user experience by eliminating
14- the need for multiple logins. This requires, however, some support from
15- the guest OS.
10+ When users log into the web GUI, they have already authenticated with the
11+ VM-Operator. In some environments, requiring an additional login on the
12+ guest OS can be cumbersome. To enhance the user experience, the VM-Operator
13+ supports automatic login on the guest operating system, thus eliminating
14+ the need for multiple logins. However, this feature requires specific
15+ support from the guest OS.
1616
1717## Prepare the VM
1818
19- Automatic login requires an agent in the guest OS. Similar to QEMU's
20- standard guest agent, the VM-Operator agent communicates with the host
21- through a tty device (` /dev/virtio-ports/org.jdrupes.vmop_agent.0 ` ). On a modern
22- Linux system, the device is detected by ` udev ` which triggers the start
23- of a systemd service.
19+ Automatic login requires an agent running inside the guest OS. Similar
20+ to QEMU's standard guest agent, the VM-Operator agent communicates with
21+ the host via a tty device (` /dev/virtio-ports/org.jdrupes.vmop_agent.0 ` ). On
22+ modern Linux systems, ` udev ` can detect this device and trigger the start
23+ of an associated systemd service.
2424
25- Sample configuration files can be found
25+ Sample configuration files for a VM-Operator agent are available
2626[ here] ( https://github.com/mnlipp/VM-Operator/tree/main/dev-example/vmop-agent ) .
2727Copy
2828
29- * ` 99-vmop-agent.rules ` to ` /usr/local/lib/udev/rules.d/99-vmop-agent.rules ` ,
30- * ` vmop-agent ` to ` /usr/local/libexec/vmop-agent ` and
31- * ` vmop-agent.service ` to ` /usr/local/lib/systemd/system/vmop-agent.service ` .
29+ * ` 99-vmop-agent.rules ` → ` /usr/local/lib/udev/rules.d/99-vmop-agent.rules ` ,
30+ * ` vmop-agent ` → ` /usr/local/libexec/vmop-agent ` and
31+ * ` vmop-agent.service ` → ` /usr/local/lib/systemd/system/vmop-agent.service ` .
3232
33- Note that some of the target directories do not exist by default and have to
34- be created first. Don't forget to run ` restorecon ` on systems with SELinux.
33+ Some of these target directories may not exist by default and must be
34+ created manually. If your system uses SELinux, run ` restorecon ` to apply
35+ the correct security contexts.
3536
36- Enable everything :
37+ Enable the agent :
3738
3839``` console
3940# systemctl daemon-reload
@@ -44,41 +45,43 @@ Enable everything:
4445
4546## The VM operator agent
4647
47- Communication with the VM-Operator agent follows the pattern established
48- by protocols such as SMTP and FTP. The agent must handle the commands
49- "` login <username> ` " and "` logout ` ". In response to these commands, the agent
50- sends back lines that start with a three digit number. The first digit
51- determines the type of message: "1" for informational, "2" for success
52- "4" and "5" for errors. The second digit provides information about the
53- category that the response relates to. The third digit is specific to
54- the command.
48+ Communication with the VM-Operator agent follows the pattern established by
49+ protocols such as SMTP and FTP. The agent must handle the commands
50+ "` login <username> ` " and "` logout ` " on its input . In response to
51+ these commands, the agent sends back lines that start with a three
52+ digit number. The first digit determines the type of message: "1" for
53+ informational, "2" for success and "4" or " 5" for errors. The second
54+ digit provides information about the category that a response relates
55+ to. The third digit is specific to the command.
5556
56- While this describes the general pattern, the only response code that
57- the runner evaluates are :
57+ While this describes the general pattern, the [ runner ] ( runner.html )
58+ only evaluates the following codes :
5859
5960| Code | Meaning |
6061| ---- | ------- |
6162| 220 | Sent by the agent on startup |
6263| 201 | Login command executed successfully |
6364| 202 | Logout command executed successfully |
6465
65- The sample script is written for the gnome desktop environment. It assumes
66- that gdm is running as a service by default. On receiving the login command,
67- it stops gdm and starts a gnome-session for the given user. On receiving the
68- logout command, it terminates the session and starts gdm again.
66+ The provided sample script is written for the gnome desktop environment.
67+ It assumes that GDM is running as a service by default. When the agent
68+ receives a login command, it stops GDM and starts a gnome-session for
69+ the specified user. Upon receiving the logout command, it terminates
70+ the session and starts GDM again.
6971
7072No attempt has been made to make the script configurable. There are too
7173many possible options. The script should therefore be considered as a
72- starting point that you can adapt to your needs.
74+ starting point that you may need to adapt to your specific needs.
7375
74- The sample script also creates new user accounts if a user does not exist
75- yet. The idea behind this is further explained in the
76+ In addition to starting the desktop for the logged in user, the sample
77+ script automatically creates user accounts if they do not already exist.
78+ The idea behind this behavior is further explained in the
7679[ section about pools] ( pools.html#vm-pools ) .
7780
7881## Enable auto login for a VM
7982
8083To enable auto login for a VM, specify the user to be logged in in the VM's
8184definition with "` spec.vm.display.loggedInUser: user-name ` ". If everything has been
8285set up correctly, you should be able to open the console and observe the
83- change from gdm 's login screen to the user's desktop when updating the
86+ transition from GDM 's login screen to the user's desktop when updating the
8487VM's spec.
0 commit comments