Skip to content

Update to IDV services #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 36 additions & 9 deletions idv-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
This file contains steps to launch virtual machines using a system service.

## Table of Contents
- [Virtual machine configuration file](#virtual-machine-configuration-file)
- [Modify VM configuration](#modify-vm-configuration)
- [Run IDV services via an RPM package](#run-idv-services-via-an-rpm-package)
- [Manual steps to run IDV service](#manual-steps-to-run-idv-service)
- [Run script to copy necessary files to `/opt` directory](#step-1-run-script-to-copy-necessary-files-to-opt-directory)
1. [Virtual machine configuration file](#virtual-machine-configuration-file)
2. [Modify VM configuration](#modify-vm-configuration)
3. [Run IDV services via an RPM package](#run-idv-services-via-an-rpm-package)
4. [Manual steps to run IDV service](#manual-steps-to-run-idv-service)
- [Run script to copy necessary files to `/usr/bin` directory](#step-1-run-script-to-copy-necessary-files-to-usrbin-directory)
- [Enable and start `idv-init` service](#step-2-enable-and-start-idv-init-service)
- [Enable and start `idv-launcher` service](#step-3-enable-and-start-idv-launcher-service)
- [Troubleshooting](#troubleshooting)
5. [Enable auto-login for the `guest` user](#enable-auto-login-for-the-guest-user)
6. [Post-Reboot Instructions](#post-reboot-instructions)
7. [Troubleshooting](#troubleshooting)

## Virtual machine configuration file

Expand Down Expand Up @@ -44,12 +46,11 @@ This file contains steps to launch virtual machines using a system service.

- If you prefer not to use the RPM package, follow these steps:

## Step 1: Run script to copy necessary files to `/opt` directory
## Step 1: Run script to copy necessary files to `/usr/bin` directory

- Navigate to the `idv` directory and run the `copy_files.sh` file with superuser privileges using the following command
- Run the `copy_files.sh` file with superuser privileges using the following command

```bash
cd idv
sudo chmod +x copy_files.sh
sudo ./copy_files.sh
```
Expand Down Expand Up @@ -101,6 +102,32 @@ This file contains steps to launch virtual machines using a system service.
```
**Note**: Once the idv-launcher service starts, all the VMs should be launched in respective monitors.

## Enable auto-login for the `guest` user

- To, enable auto-login for the `guest` user, place the [autologin.conf](autologin.conf) file in the `/etc/systemd/system/getty@tty1.service.d` directory. Run the following command from the `idv-services/` directory -

```bash
# Create `getty@tty1.service.d` if it doesn't exist
sudo mkdir /etc/systemd/system/getty@tty1.service.d
sudo cp autologin.conf /etc/systemd/system/getty@tty1.service.d/
```

**Note**: When autologin is enabled for the `guest` user, they will be automatically logged in after each reboot.

## Post-Reboot Instructions

- If the machine is rebooted, navigate to the `idv-services/` directory and run the following command to reset permissions:

```bash
sudo ./setup_permissions.sh
```
- Once this script is executed, the IDV services (idv-int.service and idv-launcher.service) should start automatically. Verify their status using:

```bash
systemctl --user status idv-int.service
systemctl --user status idv-launcher.service
```

## Troubleshooting

- If the `idv-init` service fails to start, check the service logs using the following command:
Expand Down
3 changes: 0 additions & 3 deletions idv-services/copy_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ username=$(getent passwd 1000 | cut -d: -f1)

# create/copy launcher files
sudo cp -r launcher /usr/bin/idv/
sudo touch /usr/bin/idv/launcher/start_all_vms.log
sudo chmod +x /usr/bin/idv/launcher/start_all_vms.log
sudo chown $username:$username /usr/bin/idv/launcher/start_all_vms.log

# create/copy init files
sudo cp -r init /usr/bin/idv/
Expand Down
2 changes: 1 addition & 1 deletion idv-services/etc/systemd/user/idv-init.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Type=simple
Environment=DISPLAY=:0
ExecStartPre=-/bin/bash -c 'cd /usr/bin/idv/init && /usr/bin/sudo ./setup_display.sh'
ExecStart=/usr/bin/sudo /usr/bin/X
ExecStartPost=/bin/bash -c 'cd /usr/bin/idv/init && /usr/bin/sudo ./setup_sriov_vfs.sh'
ExecStartPost=/bin/bash -c 'sleep 3 && cd /usr/bin/idv/init && /usr/bin/sudo ./setup_sriov_vfs.sh'
ExecStartPost=/usr/bin/xhost +
ExecStartPost=/bin/bash -c 'openbox &'
Restart=on-failure
Expand Down
4 changes: 0 additions & 4 deletions idv-services/intel-idv-services.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ install -m 644 idv-launcher.service %{buildroot}%{_userunitdir}/idv-launcher.ser
mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/getty@tty1.service.d
install -m 644 autologin.conf %{buildroot}%{_sysconfdir}/systemd/system/getty@tty1.service.d/autologin.conf

# Default presets for user
mkdir -p %{buildroot}%{_prefix}/lib/systemd/user-preset
install -m 644 %{SOURCE1} -t %{buildroot}%{_prefix}/lib/systemd/user-preset/

%files
/usr/bin/idv/*
/usr/lib/systemd/user/idv-*.service
Expand Down
4 changes: 2 additions & 2 deletions idv-services/rpm-packaging-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ sudo ./setup_permissions.sh

### Post-Reboot Instructions

- If the machine is rebooted, navigate to the `idv/` directory and run the following command to reset permissions:
- If the machine is rebooted, navigate to the `idv-services/` directory and run the following command to reset permissions:

```bash
sudo ./setup_permissions.sh
Expand Down Expand Up @@ -173,6 +173,6 @@ sudo ./setup_permissions.sh
You can also check the journalctl logs for errors using the command:

```bash
sudo cat journalctl -t idv-services
sudo journalctl -t idv-services
```
Ensure that the `vm.conf` file is correctly configured and all required files (e.g., firmware and qcow2 files) are present and the file paths are valid.
Loading