Janus is a tool for switching between Linux and Windows dual-boot systems, with support for control via Telegram Bot.
The project name
Januswas bestowed by Google Gemini, symbolizing: "Janus is the two-faced god in Roman mythology, with one face looking to the past and the other to the future. He is the god of doorways, beginnings, and transitions."
The core principle of Janus is message passing through Redis. When Janus receives commands from the Telegram Bot, it sends the commands to the Janus process via Redis, which then executes the corresponding operations based on the commands.
Janus relies on Grub for system switching, so you need to ensure that Grub is properly installed. Linux system should be set as the default boot option in Grub.
Switch to Windows: When Janus receives the "Switch to Windows" command, it executes grub-reboot "Windows Boot Manager (on /dev/nvmexxxxx)" command, then reboots the system.
Switch to Linux: When Janus receives the "Switch to Linux" command, it executes shutdown /r /t 0 command, then reboots the system. At this point, Grub will boot the default boot option, which is the Linux system.
- Ensure Linux system is set as the default boot option in Grub.
- Copy the Windows Boot Manager entry from Grub and write it into
config.yaml.
- Download the latest version of Janus according to your system architecture
- Copy the
janusfile to the/opt/janus/directory wget https://raw.githubusercontent.com/RealTong/Janus/refs/heads/main/config.example.yaml -O /opt/janus/config.yaml- Edit the
config.yamlfile and modify the configuration according to your actual situation. vim /etc/systemd/system/janus.service[Unit] Description=Janus - System Control Service After=network.target Wants=network.target [Service] Type=simple User=root WorkingDirectory=/opt/janus ExecStart=/opt/janus/janus Restart=always RestartSec=10 StandardOutput=journal StandardError=journal SyslogIdentifier=janus NoNewPrivileges=false PrivateTmp=false [Install] WantedBy=multi-user.target
systemctl daemon-reloadsystemctl enable janussystemctl start janus- Check Janus service status:
systemctl status janus - Stop Janus service:
systemctl stop janus - Restart Janus service:
systemctl restart janus
- Download the latest version of Janus according to your system architecture
- Copy the
janusfile to theC:\Program Files\janus\directory wget https://raw.githubusercontent.com/RealTong/Janus/refs/heads/main/config.example.yaml -O C:\Program Files\janus\config.yaml- Edit the
config.yamlfile and modify the configuration according to your actual situation. - Download and install NSSM:
https://nssm.cc/release/nssm-2.24.zip - Extract NSSM and copy
nssm.exeto theC:\Program Files\janus\directory (ensurenssm.exeandjanus.exeare in the same directory) - Open command prompt and execute
nssm.exe install Janus "C:\Program Files\janus\janus.exe" - Open the
Servicesmanager, find theJanusservice, clickStart, and set it to start automatically at boot.