0

Until yesterday, I was happy with my partition schema:

Device         Boot   mounted at    
/dev/nvme0n1p1 *      /boot/efi
/dev/nvme0n1p2        swap
/dev/nvme0n1p3        /             ext4
/dev/nvme0n1p6        /media/Volume ext4
/dev/nvme0n1p5        /home         ext4

I also use Windows 10 with virtual box, the vdi is somewhere in /home.

Now I am forced to enlarge the sice of the vdi and, albeit possible, I don't want to have a 100GB vdi file in my /home. Because I appreciate the idea of being able to boot windows natively and I have > 100GB unparitioned space on my disk, so I

  1. created raw img: VBoxManage internalcommands converttoraw Win7.vdi win10.img
  2. analyzed output: parted win10.img unit B print

Number Start End Size Type File system Flags 1 1048576B 105906175B 104857600B primary ntfs boot 2 105906176B 54022924799B 53917018624B primary ntfs 3 54023684096B 54522806271B 499122176B primary ntfs diag

  1. created an unformatted partition at /dev/nvme0n1p7 using gparted
  2. copied the second partition from win10.img: sudo dd if=.local/win10.img of=/dev/nvme0n1p7 skip=105906176 count=53917018624 iflag=skip_bytes,count_bytes

Now if I mount it with sudo mount /dev/nvme0n1p7 /media/x, it complains that windows was not shutdown appropriately and that I shall mount it ro. I fixed that usingntfsfix. It looks like there's a solid windows installation on /dev/nvme0n1p7.

Unfortunately, I cannot boot it, neither using virtual box not grub. For VirtualBox, I created a raw disk using VBoxManage internalcommands createrawvmdk -filename win10.vmdk -rawdisk /dev/nvme0n1 -partitions 7. After starting the vbox, a black screen appears and that's it. For grub, I edited /etc/grub.d/40_custom:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Windows 10 (loader) (on /dev/nvme0n1p7)" {
 insmod part_msdos
 insmod ntfs
 set root='(hd0,msdos7)'
 chainloader +1
}

then I run sudo update-grub. It displays error: not a valid root device.

I read that grub cannot start windows directly, but only starts a dedicated windows bootloader (chainloader). I think my problem is that I don't have it.

My Questions: How can I obtain and install that windows bootloader? How can I boot the partition with vbox?

0

1 Answer 1

0

I didn't solve the problem, but reinstalled the whole system (install Windows 10 first, then shrink windows partitions from a live linux and create new partitions for Arch, then install Arch into them). Using rEFInd, I can boot into either Windows or Arch. From Arch, I can boot the Windows in VirtualBox using raw disk.

The hardest issues were:

  1. What partitions should I use? There is not the windows partition. Rather, there are 4:

    • Basic data partition (ntfs, 500MiB)
    • EFI system partition (fat32, 100MiB)
    • Microsoft reserved parition (?, 16MiB)
    • Basic data partition (ntfs, 100GiB)

    Solution: use all 4 (VBoxManage internalcommands createrawvmdk -filename /whatever/you/want.vmdk -rawdisk /dev/nvme0n1 -partitions 1,2,3,4 -relative). I'm not sure if all are required, but it works.

  2. Virtual Box does not boot. Even though it has all information (all partitions mentioned above): Enable efi mode (Settings -> System -> Enable EFI (special OSes only)).

  3. Permission issues: Add your user to the disk-group: sudo usermod -a -G disk $USER.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .