Skip to content

Instantly share code, notes, and snippets.

@fsworld009
Last active January 4, 2023 09:56
Show Gist options
  • Save fsworld009/5f0ff0c5541079c4d28bdbc692fc15cf to your computer and use it in GitHub Desktop.
Save fsworld009/5f0ff0c5541079c4d28bdbc692fc15cf to your computer and use it in GitHub Desktop.
HP Elitebook 830 G8 Pop!_os installation note

Not so important notes

Reinstall Windows

https://support.hp.com/tw-zh/document/c06177099 I first created Win10 Pro USB with drivers, but it couldn't detect product key in this device. I created again without drivers, this time it can reinstall Win10 Pro properly.

VirtualBox install WIndows 10 with OEM key

Fetch OEM key https://www.medo64.com/2020/10/windows-product-key-in-virtualbox-bios/

cat /sys/firmware/acpi/tables/MSDM > msdm_table.dat
vboxmanage setextradata "VMName" "VBoxInternal/Devices/acpi/0/Config/CustomTable" /msdm_table.dat

Didn't proceed afterwards

Convert HP Win10 Pro USB to iso (doesn't work)

Virtualbox doesn't support usb boot out of box, and I think it's better to create an ISO and keep it anyway.

Insert USB, mount it

cd ~
mkdir usb
lsblk
# Find your disk device id, assume it's sda1
sudo mount /dev/sda1 ~/usb

Getting this because my USB is damaged and is permanately in read mode, but seems mounted successfully

Error opening '/dev/sda1' read-write
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
Could not mount read-write, trying read-only

Convert to iso

sudo apt install genisoimage
mkisofs -o ~/VirtualBox\ VMs/Windows10Pro_OEM/HP_Win10Pro_Install_USB.iso -allow-limited-size  ~/usb
# check files there
sudo mount -o loop ~/VirtualBox\ VMs/Windows10Pro_OEM/HP_Win10Pro_Install_USB.iso ~/iso/
sudo umount ~/iso

Use default installation, full disk encryption. That means Win10 Pro and HP recovery partition is erased as well

Hibernation support

Based on: https://pop-planet.info/forums/threads/guide-to-hibernate-answer-is-a-guide.426/#post-4358

# hibernation UEFI Bios systemd-boot kernelstub swapfile

# Create swapfile
fallocate -l [N]G /swapfile # [N] = swapfile size in GB
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

# Edit fstab
# Add
/swapfile none swap defaults 0 0

# Remove default swap:
sudo swapoff -a
sudo cryptsetup remove cryptswap
# edit `/etc/fstab`, comment the line mentioning cryptswap
# edit `/etc/crypttab `, comment the line mentioning cryptswap

# checking the status of the swap, it should have been disabled
sudo cryptsetup status /dev/mapper/cryptswap
# /dev/mapper/cryptswap is inactive.

# To check swap status, use:
> swapon --show

# The following command may be used to identify swap_file_offset:
filefrag -v /swapfile | awk '{ if($1=="0:"){print $4} }'
# ==> the physical value where the file starts = 241664

# kernel boot parameter:
kernelstub -a "resume=/dev/mapper/data-root resume_offset=swap_file_offset"

# Add to /etc/initramfs-tools/conf.d/resume the same line kernel boot parameter

sudo update-initramfs -u
sudo update-initramfs -c -k all
> reboot

# Test hibernate
sudo systemctl hibernate 
  • sudo cryptsetup remove cryptswap1 doesn't work, mine is cryptswap
  • swapfile is 64GB since that's the maximum allowed for this device.

Britness hot key doesn't work

This is because I have installed hot key driver in Windows, this somehow changes bios state and can only be erased by a power reset

gnome-extension tweaks

Hibernation in system menu

https://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

See Desktop Integration - GNOME Extension part https://support.system76.com/articles/enable-hibernation/

Hide top bar

https://extensions.gnome.org/extension/545/hide-top-bar/

If all extensions not working

sudo apt-get install chrome-gnome-shell
gnome-shell-extension-prefs

and make sure master switch is on

IME

Built-in ibus support, but I can't get jp input to work so installed fcitx instead https://blog.jixun.moe/pop-os-21-04-install-fcitx-rime

TC: fcitx-chewing, JP: fcitx-mozc CHanged short key to Ctrl+Space: on/off and Ctrl+Shift: cycle through

Looks like it's possible to get fcitx5 https://gist.github.com/kuang-da/3e77389965cd24e726db545c690a4c1d haven't tried yet, fcitx4 works fine so probably won't bother

IME not working in Spotify https://bbs.archlinuxcn.org/viewtopic.php?id=10580 no fix for now (sad)

KVM + Virtmanager to install windoes 10 with OEM Key

sudo apt install virt-manager

Create disk with dynamic allocated disk size https://askubuntu.com/questions/1298291/how-to-create-dynamic-disks-qcow2-as-it-happens-with-vdi

cd /var/lib/libvirt/images 
sudo qemu-img create -f qcow2 -o preallocation=off win10pro_oem.qcow2 192G

https://gist.github.com/Informatic/49bd034d43e054bd1d8d4fec38c305ec https://www.youtube.com/watch?v=2SdSiJTGKLM

Create vm with virtmanager

Need to enable XML edit from preference

When editing, the following must be edited in one go, otherwise they'll be discarded on saving:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <!-- ... -->
  <qemu:commandline>
    <qemu:arg value="-acpitable"/>
    <qemu:arg value="file=/usr/share/seabios/slic.bin"/>
    <qemu:arg value="-acpitable"/>
    <qemu:arg value="file=/usr/share/seabios/msdm.bin"/>
    <qemu:arg value="-smbios"/>
    <qemu:arg value="file=/usr/share/seabios/smbios_type_0.bin"/>
    <qemu:arg value="-smbios"/>
  <qemu:arg value="file=/usr/share/seabios/smbios_type_1.bin"/>
  </qemu:commandline>
</domain>

Not sure if double quotes are required. Make sure boot options have CDRom selected and is the first boot order.

Share folder

https://adrianmejia.com/how-to-set-up-samba-in-ubuntu-linux-and-access-it-in-mac-os-and-windows/ https://askubuntu.com/questions/326529/ubuntu-12-10-unable-to-install-smbfs

sudo apt-get install samba cifs-utils

Follow the guide to configure the folder on linux side 1.

mkdir /vm_shared
sudo chmod 0777 /vm_shared
  1. sudo vim /etc/samba/smb.conf
[vm_shared]
  comment = VM SHARED FOLDER
  path = /vm_shared
  read only = no
  guest ok = yes

  1. /etc/init.d/smbd restart

Once it's done, go to windows cmd, tpye ipconfig /all, check gateway ip of ethernet, then go to

\\192.168.1.1

to access vm_shared folder

Share clipboard

https://dausruddin.com/how-to-enable-clipboard-and-folder-sharing-in-qemu-kvm-on-windows-guest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment