Skip to content

Reboot to Windows from within Arch?

Is this possible? I'm currently using the "grub-reboot" command, which can reboot into grub, and auto choose a certain entry, but it still boots to grub, and I still have to wait 5 seconds or press enter to enter Windows.

Can I use a command or script from within Arch, that I can run, which immediately reboots into Windows, skipping grub entirely?

I'm not interested in just removing the wait in grub, as I still want to use grub normally.

6 points14 comments
Open on Reddit
About this post
Posted
Archived
Removed on
Score
6 · 80% up
Kind
Text
ID
152pmuz

Author

3
posts
67
comments
0
media
View profile

22 comments

This is what I'm using:

/usr/local/bin/windows

#!/usr/bin/env bash
# Reboots the computer into Windows

if [[ $(/usr/bin/id -u) -ne 0 ]]; then
    echo "This script must be run with sudo privilages"
    exit
fi

boot_num=$(/usr/bin/efibootmgr | rg "Boot(\d+)\* Windows Boot Manager" -or '$1')
/usr/bin/efibootmgr -n $boot_num
reboot

Also in my Fish config I aliased windows to sudo windows.

11 points

My script is literally

#!/bin/bash 
efibootmgr -n 0000 
reboot

Linked it to a .desktop file with exec=gksudo. Single click gets me into Windows.

Idk why you need all that stuff but I assume you know that your doing.

0 points

yea, with

efibootmgr -n NUMBER && reboot

you need to find out which boot entry your windows install has, for me, its entry number 0000. to list all entries, do

sudo efibootmgr

4 points

This is the solution and a great one! Probably a long shot, but do you know of any methods available in Windows, that can do the same thing, but boot into Linux?

I know how to use bcdedit to set the next boot to a specific entry, but ARCH isn't in my Windows bootloader, GRUB is. So I can set next boot to be grub, but not my specific distro.

1 points

I believe if you type the entry number after grub-reboot it'll boot into that entry.

1 points

Well yes, grub-reboot 'Windows Boot Manager' (or however you need it) and wait 5 seconds... you can change the Grub Timeout to smth <5 seconds but this setting will stay and you maybe won't have enough time to choose the OS you want to boot (if you for example want to boot to Windows directly from startup)

0 points

Literally didn't read my OP lol. I addressed LITERALLY everything you just suggested and why it's not gonna work.

2 points

What you are asking for is a gross misunderstanding of how the boot process works when gone through GRUB.

You are asking to skip Grub, but Grub needs to choose the OS. You are asking for a Cake to eat and throw away

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.