68 lines
2.5 KiB
Markdown
68 lines
2.5 KiB
Markdown
# VirtualBox
|
||
|
||
### guest share
|
||
FYI: _remember to mkdir a folder for this_
|
||
`sudo mount.vboxsf media /mnt/exchange`
|
||
after adding a guest share the users need access which is granted by a group:
|
||
`sudo usermod -G vboxsf -a $USER`
|
||
|
||
|
||
sometimes it will generate a protocol error:
|
||
```
|
||
[ 6.646480] vboxsf: could not stat root of share: -71
|
||
[ 6.647218] 06:53:23.826079 automount Error: vbsvcAutomounterMountIt: Failed to mount 'exchange' on '/mnt/exchange': Protocol error (-1,71)
|
||
```
|
||
the workaround is to choose an new/other folder on the host system.
|
||
|
||
### vhd
|
||
```bash
|
||
modprobe nbd
|
||
qemu-nbd -c /dev/nbd0 image.vhd
|
||
mount /dev/nbd0 /mnt
|
||
[..work...]
|
||
umount /mnt
|
||
qemu-nbd -d /dev/nbd0
|
||
modprobe -r nbd
|
||
```
|
||
libguestfs
|
||
```bash
|
||
[install libguestfs-tools]
|
||
virt-list-partitions FILE_NAME.vhdx
|
||
guestmount -a srv-kirikas-storage.vhdx -m DEVICE --ro MOUNT_POINT
|
||
```
|
||
### vmdk
|
||
```
|
||
sudo apt install libguestfs-tools
|
||
sudo guestmount -a xyz.vmdk -m /dev/sda3 --ro /mnt/vmdk
|
||
OR sudo guestmount -a xyz.vmdk -i --ro /mnt/vmdk
|
||
sudo -i (you need to be root to access the folder)
|
||
```
|
||
|
||
### migrate from vhdk to vdi
|
||
to handle the error `Could not get the storage format of the medium (VERR_NOT_SUPPORTED)”`
|
||
```
|
||
VBoxManage convertfromraw --format VDI your-server.vmdk new-server.vdi
|
||
VBoxManage clonehd --format VDI your-server.vmdk new-server.vdi
|
||
```
|
||
|
||
but windows fails with bluescreen because of [unknown], maybe the drive driver?
|
||
|
||
### virtual bridge inside
|
||
as soon as you have a bridge inside the VM all the networking traffic is broken.
|
||
Maybe it is the copy of the MAC, which breaks it. However, after doing things, it is working now.
|
||
|
||
## UEFI and extension pack
|
||
the extention pack provides PXE-intel.rom. This option ROM needs DDIM support which is not possible by booting with UEFI. It is not sufficant to disable PXE boot, you need to rename/delete the rom-file itself.
|
||
|
||
## Secureboot
|
||
```
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> inituefivarstore
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> enrollmssignatures
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> enrollorclpk
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> enrollpk \[--platform-key=*`filename`*] \[--owner-uuid=*`uuid`*]
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> enrollmok \[--mok=*`filename`*] \[--owner-uuid=*`uuid`*]
|
||
`VBoxManage modifynvram` <*`uuid|vmname`*> listvars
|
||
```
|
||
VM needs to be off and there is currently a bug: <https://www.virtualbox.org/ticket/21848>
|
||
Somehow it is possible to register the MOK, but it seems that SecureBoot gets then unticked under the settings menu.
|