Skip to content

Instantly share code, notes, and snippets.

@simonbates
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonbates/df4a3723beba3143c7ba to your computer and use it in GitHub Desktop.
Save simonbates/df4a3723beba3143c7ba to your computer and use it in GitHub Desktop.
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use graphical install
graphical
# Use hard drive installation media
harddrive --dir=None --partition=/dev/mapper/live-base
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_CA.UTF-8
# Network information
network --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate
network --hostname=localhost.localdomain
#Root password
rootpw --lock
# System services
services --enabled="chronyd"
# System timezone
timezone America/Toronto --isUtc
user --groups=wheel --name=simon --password=$6$YXSGrx6CRFiCGxiZ$ozu4dlXDgv2WwnpaKBjrnZSnKexE8zZISdN6uyTtchctrOV7n26TUlNRuvplWKUv4ti4xWSQFZnl9qHkjmdx81 --iscrypted --gecos="Simon"
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
%packages
chrony
%end
%anaconda
pwpolicy root --minlen=6 --minquality=50 --notstrict --nochanges --emptyok
pwpolicy user --minlen=6 --minquality=50 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=50 --notstrict --nochanges --emptyok
%end

Notes on setting up a development environment for GPII with VirtualBox Fedora 22

Host environments

  • openSUSE 13.2 64 bit with VirtualBox 4.3.20 (openSUSE package)
  • Windows 7 64 bit with VirtualBox 4.3.28

Downloaded and verified the ISO

I downloaded

http://fedora.bhs.mirrors.ovh.net/linux/releases/22/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-22-3.iso

And verified the ISO

https://getfedora.org/en/static/checksums/Fedora-Workstation-22-x86_64-CHECKSUM

$ curl https://getfedora.org/static/fedora.gpg | gpg --import
$ gpg --verify-files Fedora-Workstation-22-x86_64-CHECKSUM
$ sha256sum -c Fedora-Workstation-22-x86_64-CHECKSUM

VM Details

  • Operating System: Fedora (64 bit)
  • Base Memory: 2048 MB
  • Video Memory: 128 MB
  • Acceleration: 3D
  • Storage: vdi 20.0 GB
  • Audio: ICH AC97
  • Network:
    • Adapter 1: Host-only Adapter (to enable the host to connect to the guest)
    • Adapter 2: NAT (to enable the guest to connect to the internet)

Installed guest additions

$ sudo dnf update 'kernel*'
$ sudo dnf install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

I downloaded:

http://download.virtualbox.org/virtualbox/4.3.28/VBoxGuestAdditions_4.3.28.iso

And mounted the ISO as a CD/DVD and ran the installer:

$ cd /run/media/simon/VBOXADDITIONS_4.3.28_100309
$ sudo ./VBoxLinuxAdditions.run

Installed Nodejs and npm

$ sudo dnf install nodejs
$ sudo dnf install npm
$ node --version
v0.10.36
$ npm --version
1.3.6

Installed grunt-cli

$ sudo npm install -g grunt-cli

Installed additional dependencies

$ sudo dnf install glib2-devel alsa-lib-devel libXrandr-devel PackageKit-glib-devel json-glib-devel

Built GPII

$ mkdir gpii
$ cd gpii
$ git clone https://github.com/GPII/linux.git
$ cd liunx
$ npm install
$ grunt build

Unit tests

I initially hit 2 issues when running the unit tests:

  • It is necessary to run Orca once manually before running the GPII unit tests. When Orca is first run, it populates the directory ~/.local/share/orca. This directory must be present for the tests to pass. Otherwise, there will be an Orca related failure.
  • The tests in the current (2015-07-03) linux master have an Xrandr issue under VirtualBox https://issues.gpii.net/browse/GPII-1168

There is a fix for GPII-1168 and to apply:

$ git remote add klown https://github.com/klown/linux.git
$ git fetch klown
$ git merge klown/GPII-1168

To run the unit tests:

$ cd tests
$ ./UnitTests.sh

Acceptance tests

$ cd tests
$ node AcceptanceTests.js

VirtualBox shared folder

For my development workflow, I want to run my editor and other tools on my host machine. One of the ways to accomplish this is to use a VirtualBox shared folder. The source code files live in a directory on the host machine and are made available to the guest as a filesystem mount.

I added the following shared folder:

  • Name: gpii
  • Auto-mount: Yes
  • Access: Full

Within the guest VM, this directory is mounted at /media/sf_gpii.

To access the shared folder, the VM user account must be a member of the vboxsf group:

$ sudo usermod -aG vboxsf <USER>

By default, npm uses symlinks when installing modules. However, there are issues with symlinks in VirtualBox shared folders (see https://www.virtualbox.org/ticket/10085) -- causing npm install to fail if run on a shared folder.

I was able to work around this issue by configuring npm to install without symlinks. To make this configuration, I created a file named .npmrc in my VM user's home directory with the following contents:

bin-links = false

For more information on npm configuration, see:

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