
{"id":294,"date":"2018-05-13T11:37:49","date_gmt":"2018-05-13T11:37:49","guid":{"rendered":"http:\/\/blog.gordonbuchan.com\/blog\/?p=294"},"modified":"2021-02-07T13:44:55","modified_gmt":"2021-02-07T13:44:55","slug":"formatting-a-netbook-with-dual-boot-windows-and-linux-plus-a-docker-container-for-travel-and-offline-lamp-development","status":"publish","type":"post","link":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/2018\/05\/13\/formatting-a-netbook-with-dual-boot-windows-and-linux-plus-a-docker-container-for-travel-and-offline-lamp-development\/","title":{"rendered":"Formatting a netbook with dual boot Windows and Linux, plus a Docker container for travel and offline LAMP development"},"content":{"rendered":"<p>When I travel, I like to carry the smallest and cheapest computer that can serve my needs, a netbook: the HP Stream 11\u201d netbook (C$250) is a modest Intel single-core 64 bit cpu with 2 threads, 4GB of RAM, and 57GB of usable space on a 64GB eMMC drive. This computer is inexpensive, light, and disposable. This computer can be reformatted often, as it is not my main personal computer. Although this computer has light specs, the RAM and hard drive are double the size of typical netbooks. The amount of drive space makes a multiple boot environment possible, and the amount of RAM makes Windows bearable. I have also added a 64GB micro SD card for extra storage.<\/p>\n<p>I use Linux for a lot of PHP programming. I also prefer Linux as a desktop for the performance, and for the privacy and freedom. I have to retain the ability to use Windows in case I need to connect to certain systems for work, and the computer is too limited in terms of CPU and RAM for virtualization. Don\u2019t even get me started on Wine.<\/p>\n<p>Partitioning a multiple-boot system with Windows and Linux<\/p>\n<p>This has led me to divide the 57GB drive into a 35GB Windows 10 partition, and a 22GB Fedora 28 Linux partition. Windows must be installed first, with unallocated drive space available to the Linux installer to create a new drive partition. The Linux installer will also install a multiple boot manager which will list the Windows boot partition as an available option on startup.<\/p>\n<p>Installing Windows<\/p>\n<p>If you are modifying an existing Windows installation to become multiple-boot, resize the windows partition to create free, \u201cunallocated\u201d space, which can be used by the Linux installer.<\/p>\n<p>If you are doing a fresh installation of a multiple boot system, use the Windows installer to destroy all existing partitions, then Windows system should be installed first, only partitioning the drive space needed for Windows, leaving the rest of the drive space unallocated for later use by the Linux installer.<\/p>\n<p>I don\u2019t plan to provide much further detail on how to install a Windows system, the world gives enough love to Windows already. The rest of this blog post contains my notes on installing Linux and setting up Docker containers for Linux\/Apache\/MySQL\/PHP (LAMP) web development.<\/p>\n<p>Installing Linux<\/p>\n<p>Changing Fedora 28 from a sudo\/wheel group implementation to a traditional box with root<\/p>\n<p>Prior to Fedora 28, the operating system reflected a traditional RHEL-style box, with sudo available but requiring a true root password for some operations. It would seem that Red Hat has chosen to emulate the Ubuntu permissions model, which is that of a privileged user that owns the desktop, that belongs to the wheel group (BSD style permission to use sudo command), and that accepts the privieged user\u2019s password to escalate to root using sudo as part of the command. To my mind, this means that the system effectively has no sandboxing or root password protection. I used the sudo su command to escalate to a root prompt, set a root password using the passwd command, edited the group file to remove the user owning the desktop from the wheel group, then rebooted.<\/p>\n<p>Some general notes on setting up a Fedora 28 workstation<\/p>\n<p>(My brother is the king of this kind of list.) I noticed that even when planning to do a minimal install for a temporary format for some experiments, I needed to perform the following steps to get the machine where I wanted it to be, so I decided to note them in a text file:<\/p>\n<p>systemctl stop firewalld; systemctl disable firewalld<\/p>\n<p>systemctl start sshd; systemctl enable sshd<\/p>\n<p>dnf install nano (cause you always need a text editor)<\/p>\n<p>Disable selinux:<\/p>\n<p>cd \/etc\/selinux<\/p>\n<p>nano config<\/p>\n<p>set SELINUX=disabled<\/p>\n<p>Set hostname:<\/p>\n<p>cd \/etc<\/p>\n<p>nano hostname<\/p>\n<p>Change gdm from Wayland back to x.org:<\/p>\n<p>cd \/etc\/gdm<\/p>\n<p>nano custom.conf<\/p>\n<p>remove # in front of WaylandEnable=false<\/p>\n<p>reboot<\/p>\n<p>dnf clean all;dnf update<\/p>\n<p>dnf install denyhosts<\/p>\n<p>enable desktop sharing<\/p>\n<p>adjust power settings: change timeouts for screen and hibernation on ac and battery power.<\/p>\n<p>add the following repositories:<\/p>\n<p>rpmfusion-free<\/p>\n<p>rpmfusion-non-free<\/p>\n<p>remi-release-28 (note: disabled by default you must edit the .repo file to enable prior to dnf)<\/p>\n<p>(again) dnf clean all; dnf update<\/p>\n<p>Accept GPG signatures, watch for missing RPM dependencies or conflicts between repositories.<\/p>\n<p>Installing some favorite open-source desktop applications<\/p>\n<p>vlc: video and audio player<\/p>\n<p>vncviewer: install tightvnc package<\/p>\n<p>Filezilla: FTP and SSH file transfer client<\/p>\n<p>rdesktop\/rdp123: Windows remote desktop client<\/p>\n<p>Installing binaries of proprietary software packages on Fedora 28 workstation<\/p>\n<p>Some important utilities are only available as binary-only installations, you can find the installers by using Google:<\/p>\n<p>Teamviewer<\/p>\n<p>Skype<\/p>\n<p>Installing Google Chrome on Fedora 28 workstation<\/p>\n<p>On Fedora 27, installing Google Chrome was easy, the 64 bit RPM installed without a hiccup. However, on Fedora 28, I got broken RPM dependency errors, which I had to resolve one-by-one, by googling and finding the following commands:<\/p>\n<p>dnf install redhat-lsb<\/p>\n<p>dnf install libXScrnSaver<\/p>\n<p>dnf install libappindicator<\/p>\n<p>dnf install libappindicator-devel<\/p>\n<p>dnf install libappindicator-gtk3<\/p>\n<p>Installing Google Earth on Fedora 28 workstation<\/p>\n<p>Once Google Chrome is installed with its dependencies, you can install Google Earth.<\/p>\n<p>Using Docker containers to create isolated web development platforms without virtualization<\/p>\n<p>On the Linux side, although the Fedora 28 workstation environment can easily support a Linux\/Apache\/MySQL\/PHP (LAMP) server for offline web programming, it supports PHP 7.x, which is incompatible with some older software that is still in production on Centos 7.x boxen (Fedora 19, PHP 5.x). This code is being re-factored, but the new versions are not ready for production. Rant: PHP deprecates far too aggressively, and has created a demand for legacy version PHP parsers. I chose not play with batch files and symbolic links to binaries, as I was worried about creating version mismatches, especially with glue drivers that link php and mysql.<\/p>\n<p>Again, because of the limitations of the hardware, creating and running a virtual machine guest is not a viable option. At a Linux meetup about a year ago, I learned about Docker and containers and thought they were stupid. Now, I realize that many things I learn at Linux Meetup will be useful later on.<\/p>\n<p>Installing Docker<\/p>\n<p>dnf install docker docker-compose docker-common docker-devel<\/p>\n<p>systemctl start docker; systemctl enable docker<\/p>\n<p>Using Docker images and docker compose files to install a Docker container environment<\/p>\n<p>Rather than installing a traditional LAMP stack, I have decided to install containerized environments, one for the old PHP 5.x environment, and one for the current PHP 7.x environment. I found the following links to be helpful:<\/p>\n<p><a href=\"https:\/\/github.com\/sp0ker\/lamp-docker\">https:\/\/github.com\/sp0ker\/lamp-docker<\/a><\/p>\n<p><a href=\"https:\/\/linuxconfig.org\/how-to-create-a-docker-based-lamp-stack-using-docker-compose-on-ubuntu-18-04-bionic-beaver-linux\">https:\/\/linuxconfig.org\/how-to-create-a-docker-based-lamp-stack-using-docker-compose-on-ubuntu-18-04-bionic-beaver-linux<\/a><\/p>\n<p>Despite the Ubuntu-specific reference in one of the above links, I was able to follow the procedure on a Fedora 28 workstation.<\/p>\n<p>There are endless permutations to Docker, some involving virtual machines, which I tried to avoid given the limited specs of the system on which I am installing. The 2 links above created self-contained environments that can be started using the command \u201cdocker-compose up \u2013d\u201d and can be stopped using the command \u201cdocker-compose down\u201d from within the build context of the Docker container\u2019s directory structure.<\/p>\n<p>Docker has a lot of commands and options. Two commands to help get you started:<\/p>\n<p>docker ps (lists running docker containers, note that what you consider a single container could actually be multiple linked containers, ie one for apache and php, another for mysql, and so on)<\/p>\n<p>docker exec -it 6ca756ef1b50 bash -l (in this case, a shell login to the isolated instance of the Docker container running MariaDB\/MySQL so I could run the mysql command line utility)<\/p>\n<p>Due to the nature of LAMP development, most of the time access to files within your normal shell in the Docker file directories should be enough, along with phpMyAdmin on the local web server.<\/p>\n<p>Tip: if you expect to be truly isolated and offline during your development, install an offline copy of the php.net website on your local system.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I travel, I like to carry the smallest and cheapest computer that can serve my needs, a netbook: the HP Stream 11\u201d netbook (C$250) is a modest Intel single-core 64 bit cpu with 2 threads, 4GB of RAM, and 57GB of usable space on a 64GB eMMC drive. This computer is inexpensive, light, and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/2018\/05\/13\/formatting-a-netbook-with-dual-boot-windows-and-linux-plus-a-docker-container-for-travel-and-offline-lamp-development\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Formatting a netbook with dual boot Windows and Linux, plus a Docker container for travel and offline LAMP development&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","hentry","category-linux","category-microsoft"],"_links":{"self":[{"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":5,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions\/300"}],"wp:attachment":[{"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gordonbuchan.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}