Created
January 14, 2020 07:32
-
-
Save ChatchaiJ/ead0114b48d05cd09ba0fbb3658b695d to your computer and use it in GitHub Desktop.
setup linux for run VirtualBox to run Windows 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PC is Dell Optiplex 7050 | |
- Two HDDs use as software raid | |
- System must use gpt, and also boot from EFI | |
- Debian Linux as base system | |
- Runing VirtualBox | |
- Windows-7 for ASRS as guest on VirtualBox | |
- Win7 should start automatically after system up, | |
so user won't confused with linux | |
- choose lightdm as DM | |
- VirtualBox use version 6.1 since Win7 ova created by 6.0 | |
# Linux installation | |
1. using non-free firmware netinstall iso | |
2. manual installed | |
3. create disk partitions | |
/dev/sda | |
sda1 100MB EFI System | |
sda2 8GB Linux Raid | |
sda3 460GB Linux Raid | |
/dev/sdb | |
sdb1 100MB EFI System | |
sdb2 8GB Linux Raid | |
sdb3 460GB Linux Raid | |
4. raid setup | |
/dev/md0 - raid1 -- sda2, sdb2 use as swap | |
/dev/md1 - raid1 -- sda2, sdb2 use as / | |
5. create normal user, set password, add to group gdm, sudo | |
7. create 'kiosk' user | |
groupadd -r autologin | |
useradd -m kiosk -s /bin/bash -c "Kiosk user" | |
gpasswd -a kiosk autologin | |
8. install lightdm | |
9. download and install virtualbox-6.1 | |
wget .../virtualbox-6.1_6.1.0-135406~Debian~stretch_amd64.deb | |
wget .../Oracle_VM_VirtualBox_Extension_Pack-6.1.0.vbox-extpack | |
dpkg -i virtualbox...deb | |
# it will failed, since dependency is not met, fixed by 'apt --fix-broken install' | |
apt --fix-broken install | |
# also virtualbox will need necessary package to build kernel modules | |
apt-get install linux-header-amd64 linux-headers-`uname -r`-amd64 | |
apt-get install build-essential | |
usermod -a -G vboxusers kiosk | |
# and also other essentail packages | |
apt-get install xterm openssh-server vim tmux sudo htop lsof strace | |
apt-get install x11-xserver-utils # for xrandr | |
10. fix network configuration, and /etc/apt/sources.list if necessary | |
/etc/network/interfaces.d/enp0s31f6 | |
auto enp0s31f6 | |
iface enp0s31f6 dhcp | |
/etc/apt/sources.list | |
11. modified PATH in /etc/profiles | |
PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:. | |
12. modififed /etc/lightdm/lightdm.conf for kiosk user to autologin | |
[Seat:*] | |
autologin-userr=kiosk | |
autologin-session=lightdm-xsession | |
display-setup-script=/usr/local/bin/lightdm-set-resolution.sh | |
13. There was some conflict with Win-7 guest resolution, and linux X-windows | |
detected resolution, the only one that matches both was 1152x864, so | |
this script /usr/local/bin/lightdm-set-resolution.sh are used to fix | |
the problem with losing some desktop space. | |
#!/bin/sh | |
# use 'xrandr -q' to get available mode | |
xrandr --output HDMI-1 --primary --mode 1152x864 | |
14. import windows 7 ova | |
sudo -u kiosk -c "VBoxManage import oot07-pc.ova" | |
15. install extension pack for VirtualBox | |
VBoxManage list extpacks | |
VBoxManage extpack install Oracle_VM_V...-extpack | |
16. modified to make VirtualBox not to show logo | |
VBoxManage modifyvm oot07-pc --bioslogodisplaytime 1 | |
# that is 1 ms, 0 ms won't work! | |
17. modified kiosk's .xsessionrc | |
VBoxSDL --startvm oot07-pc --fullscreen | |
sudo /sbin/shutdown -h now | |
18. modified /etc/default/grub to hide grub menu at boot | |
GRUB_DEFAULT=0 | |
GRUB_TIMEOUT=1 | |
GRUB_TIMEOUT_STYLE=hidden | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" | |
GRUB_CMDLINE_LINUX="" | |
GRUB_HIDDEN_TIMEOUT=0 | |
GRUB_HIDDEN_TIMEOUT_QUIET=true | |
GRUB_DISALBE_OS_PROBER=true | |
GRUB_RECORDFAIL_TIMEOUT=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment