<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Programmable Production</title>
    <description>For developer who want to learn devops
</description>
    <link>http://blog.programmableproduction.com/</link>
    <atom:link href="http://blog.programmableproduction.com/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Sun, 08 Apr 2018 00:28:48 +0000</pubDate>
    <lastBuildDate>Sun, 08 Apr 2018 00:28:48 +0000</lastBuildDate>
    <generator>Jekyll v3.7.3</generator>
    
      <item>
        <title>Archlinux setup Minikube using KVM</title>
        <description>&lt;p&gt;Kubernete is a system that simplify the deployment of containerized application by providing support for deployment, orchestration, management and scalability of application. This is an open source project, which was borned out of google lab and was given to the open source community.&lt;/p&gt;

&lt;p&gt;Kubernete has all the feature required for high availability production system, which is great, but what about developer… Welcome to &lt;a href=&quot;https://github.com/kubernetes/minikube/&quot;&gt;minikube&lt;/a&gt; a tool that allow you to run a single node kubernete on your development workstation inside a VM. Minikube allow you to run like in production using any host OS that you use for your development, Windows, MacOs or Linux.&lt;/p&gt;

&lt;p&gt;If you are using windows they are a nice &lt;a href=&quot;https://sachabarbs.wordpress.com/2018/01/31/kubernetes-installing-minikube-part-1-of-n/&quot;&gt;article&lt;/a&gt; from Sacha that explain how to install and setup minikube on Windows. 
My development setup today is 100% on linux using &lt;a href=&quot;https://www.archlinux.org/&quot;&gt;arch linux&lt;/a&gt; as the base OS. I will explain in this article the step required to setup my minikube on ArchLinux. As I faced some issue on a way, this could help.&lt;/p&gt;

&lt;h1 id=&quot;minikube-installation&quot;&gt;MiniKube Installation&lt;/h1&gt;

&lt;h2 id=&quot;why-kvm-&quot;&gt;Why KVM ?&lt;/h2&gt;

&lt;p&gt;Why am I using KVM ?
This is not the default driver for minikube. They are a lot of option of driver to use depending on the OS you are using. KVM is part of the Kernel on most Linux distribution todat and would be the best solution as it doesn’t required any third party software but only some library potentually. For that reason I went with KVM. 
The second point is that when I tried to use minikube on Archlinux with the virtualbox driver I ran into a lot of issue and never been able to get around them. Maybe it was me, but I never find the answer online to get minikube running with virtualbox. This is why I looked at another solution and KVM was the option which turn out to be the good one for me.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Linux Drivers&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;VirtualEnv : This is the default one&lt;/li&gt;
      &lt;li&gt;VMWare Fusion : Available with Minikube by default&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm-driver&quot;&gt;KVM&lt;/a&gt; : Driver that use Linux Kernel base virtual machine. This driver is deprecated to the newer one KVM2&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver&quot;&gt;KVM2&lt;/a&gt; : Newer version of for KVM driver&lt;/li&gt;
      &lt;li&gt;None : With Linux you have the option to run minikube without any driver. However this required to run minikube on admin mode.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MacOs Drivers&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;VirtualEnv : This the default one.&lt;/li&gt;
      &lt;li&gt;VMWare Fusion : Available with Minikube by default&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#xhyve-driver&quot;&gt;xhyve&lt;/a&gt; : Lightweight virtualization env for MacOs. This is the prefer driver to use on MacOs&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver&quot;&gt;Hyperkit&lt;/a&gt; : Will potentially replaced the xhyve driver in the future&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Windows Drivers&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;VirtualEnv : This the default one.&lt;/li&gt;
      &lt;li&gt;VMWare Fusion : Available with Minikube by default&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperv-driver&quot;&gt;HyperV&lt;/a&gt; : This is only available for the windows 10 Enterprise, Profesional or Education. If you are running Windows 10 Home this feature won’t be available.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;requirement&quot;&gt;Requirement&lt;/h2&gt;

&lt;p&gt;MiniKube with KVM require some library to be installed on your machine, mainly to inferface with the virtualization layer.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.archlinux.org/packages/community/x86_64/docker-machine/&quot;&gt;Docker Machine&lt;/a&gt; : Helper command line that allow you to install docker on the computer or use an abstraction layer like KVM to host images&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://aur.archlinux.org/packages/docker-machine-driver-kvm2/&quot;&gt;Docker Machine KVM2&lt;/a&gt; : Plug-in to docker machine that use KVM for the underline&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/Libvirt&quot;&gt;Libvirt&lt;/a&gt; : Virtualization API library&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/QEMU&quot;&gt;qemu&lt;/a&gt; : Hypervisor&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://aur.archlinux.org/packages/minikube/&quot;&gt;minikube&lt;/a&gt; : Kubernete on your workstation&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://aur.archlinux.org/packages/kubectl-bin/&quot;&gt;KubeCtl&lt;/a&gt; : Command line that allow you to interact with kubernete&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The installation process require some package that are only maintain on the AUR. You need to be sure that you have at &lt;a href=&quot;https://archlinux.fr/yaourt-en&quot;&gt;yaourt&lt;/a&gt; package manager installed or another one. In this example I’m using yaourt&lt;/p&gt;

&lt;h2 id=&quot;installing-libvirt-and-qemu&quot;&gt;Installing Libvirt and qemu&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/libvirt&quot;&gt;Libvirt&lt;/a&gt; and &lt;a href=&quot;https://wiki.archlinux.org/index.php/QEMU&quot;&gt;qemu&lt;/a&gt; are the base for the virtualization. We need to install them as well as the network connectivuty requirement for NAT/DHCP. It is important to install all the network requirement otherwise you would not be able to start minikube.
In this installation we are installing the version of qemu without any GUI. You can replace &lt;em&gt;qemu-headless&lt;/em&gt; with &lt;em&gt;qemu&lt;/em&gt; if you want a GUI.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-Sy&lt;/span&gt; libvirt qemu-headless ebtables dnsmasq 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the installation, we have to enable the daemon. The daemon libvirtd should enable virtlogd, however they are no arm activating both of them. 
If you want to start the daemon without restarting your machine you can run the commands with &lt;em&gt;start&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;libvirtd.service
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;virtlogd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;installing-docker-machine&quot;&gt;Installing Docker-machine&lt;/h2&gt;
&lt;p&gt;Docker machine is a machine management container. This need to be installed to be able to pulled out any container or image required.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-Sy&lt;/span&gt; docker-machine
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;installing-minikube-and-kubectl&quot;&gt;Installing minikube and kubectl&lt;/h2&gt;
&lt;p&gt;Minikube and kubectl installation is as simple as using the package available on the AUR.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yaourt &lt;span class=&quot;nt&quot;&gt;-Sy&lt;/span&gt; minikube-bin kubectl-bin  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;installing-kvm2-driver-for-minikube&quot;&gt;Installing KVM2 driver for minikube&lt;/h2&gt;
&lt;p&gt;Docker machine KVM2 is the driver required by minikube to run with the new version of KVM&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yaourt &lt;span class=&quot;nt&quot;&gt;-Sy&lt;/span&gt; docker-machine-driver-kvm2  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;starting-minikube&quot;&gt;Starting minikube&lt;/h1&gt;
&lt;p&gt;All the packages and requirement are installed now, we can start our minikube and test that everything is working as expected. During the initialialization we will look at how to I fixed some of the basic network issue.&lt;/p&gt;

&lt;h2 id=&quot;starting-minikube-1&quot;&gt;Starting minikube&lt;/h2&gt;
&lt;p&gt;All the components installed now, we can run the following command to start our kubernete cluster which will download the VM image.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;minikube start &lt;span class=&quot;nt&quot;&gt;--vm-driver&lt;/span&gt; kvm2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However you could get this type of error message.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;mycomputer]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt; minikube start &lt;span class=&quot;nt&quot;&gt;--vm-driver&lt;/span&gt; kvm2
Starting &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;Kubernetes v1.9.0 cluster...
Starting VM...
E0306 08:05:44.945523   16047 start.go:159] Error starting host: Error starting stopped host: Error creating VM: virError&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Code&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;55, &lt;span class=&quot;nv&quot;&gt;Domain&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;19, &lt;span class=&quot;nv&quot;&gt;Message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Requested operation is not valid: network '&lt;/span&gt;default&lt;span class=&quot;s1&quot;&gt;' is not active'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;

Retrying.
E0306 08:05:44.945839   16047 start.go:165] Error starting host:  Error starting stopped host: Error creating VM: virError&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Code&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;55, &lt;span class=&quot;nv&quot;&gt;Domain&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;19, &lt;span class=&quot;nv&quot;&gt;Message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Requested operation is not valid: network '&lt;/span&gt;default&lt;span class=&quot;s1&quot;&gt;' is not active'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;================================================================================&lt;/span&gt;
An error has occurred. Would you like to opt &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;to sending anonymized crash
information to minikube to &lt;span class=&quot;nb&quot;&gt;help &lt;/span&gt;prevent future errors?
To opt out of these messages, run the &lt;span class=&quot;nb&quot;&gt;command&lt;/span&gt;:
minikube config &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;WantReportErrorPrompt &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;================================================================================&lt;/span&gt;
Please enter your response &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Y/n]: 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This mean that the virtual network defaul is not started or hasn’t been created properly. This &lt;a href=&quot;http://ask.xmodulo.com/network-default-is-not-active.html&quot;&gt;article&lt;/a&gt; summarize well how to fix the problem, and you can find a great article about &lt;a href=&quot;https://jamielinux.com/docs/libvirt-networking-handbook/nat-based-network.html&quot;&gt;virsh&lt;/a&gt; from Jamie Nguyen that explain in more detail the internals.&lt;/p&gt;

&lt;h2 id=&quot;fixing-network-default-is-not-active&quot;&gt;Fixing “network ‘default’ is not active”&lt;/h2&gt;
&lt;p&gt;You can jump to the next section if your minikube instance started, and keep reading this section if you are unlucky :-(&lt;/p&gt;

&lt;p&gt;First we have to check the status of the virtual network and be sure the ‘default’ virtual network is present.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;mycomputer]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;virsh net-list &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt; 
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; password &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;myuser: 
Name                 State      Autostart     Persistent
&lt;span class=&quot;nt&quot;&gt;----------------------------------------------------------&lt;/span&gt;
default              inactive   no            yes
minikube-net         active     yes           yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;“Default” exist but no active. So we have to enable it and set it to autostart. This is the role of the two following commands.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;virsh net-start default 
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;virsh net-autostart default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result of this command should be that&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;mycomputer]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;virsh net-list &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt; 
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; password &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;myuser: 
Name                 State      Autostart     Persistent
&lt;span class=&quot;nt&quot;&gt;----------------------------------------------------------&lt;/span&gt;
default              active     yes           yes
minikube-net         active     yes           yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From that point we should be good to start our cluster using the previous step.&lt;/p&gt;

&lt;h2 id=&quot;minikube---kubernete-dashboard&quot;&gt;Minikube - kubernete dashboard&lt;/h2&gt;
&lt;p&gt;Kubernete has a web-ui &lt;a href=&quot;https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/&quot;&gt;dashboard&lt;/a&gt; that allow you to manage your cluster. This dashboard is installed by default on minikube which allow you to see the state of the cluster.&lt;/p&gt;

&lt;p&gt;To open directly on your default brower&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;mycomputer]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;minikube dashboard
Opening kubernetes dashboard &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;default browser...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To get the url of the dashboard&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;mycomputer]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;minikube dashboard &lt;span class=&quot;nt&quot;&gt;--url&lt;/span&gt;
http://192.168.39.2:30000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This a view of the dashboard main page.
&lt;img src=&quot;/assets/posts/2018-03-08-Archlinux Setup Minikube using KVM/kubernete-dashboard.png&quot; alt=&quot;Kubernete dashboard&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;what-next-&quot;&gt;what next ?&lt;/h1&gt;

&lt;p&gt;This is some link that I found useful for the next step about using kubernete. The “Hello Minikube” is a nice first step to go through&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Hello Minikube : &lt;a href=&quot;https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/&quot;&gt;https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Minikube getting started : &lt;a href=&quot;https://kubernetes.io/docs/getting-started-guides/minikube/&quot;&gt;https://kubernetes.io/docs/getting-started-guides/minikube/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Thu, 08 Mar 2018 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/</guid>
        
        <category>Archlinux,</category>
        
        <category>setup,</category>
        
        <category>Kubernete,</category>
        
        <category>minikube</category>
        
        
        <category>Archlinux</category>
        
      </item>
    
      <item>
        <title>CoreClr problem with ICU dependency on Linux</title>
        <description>&lt;p&gt;This post follows the &lt;a href=&quot;/2016/04/08/Building-CoreClr-On-ArchLinux/&quot;&gt;previous article&lt;/a&gt; about building .Net CoreClr on ArchLinux. The instruction that are in that post  show you how to install the dependency for ArchLinux, however they are still a problem about building mscorelib.dll on Archlinux. I will summarise the problem, how I investigated the root cause and some solution that I’m looking at to merge back to the CoreClr github repository later.&lt;/p&gt;

&lt;h1 id=&quot;the-problem&quot;&gt;The problem&lt;/h1&gt;
&lt;p&gt;The build process of the .Net CoreClr is mainly building some C++ native library (like JIT, PAL) which are doing the translation of IL code to machine code and all the platform abstraction layer. The last build step is building mscorelib.dll which is the base library of .Net. However this is failing with the below error&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Restoring BuildTools...
Raising file open limit - otherwise Mac build may fail
ulimit -n 2048
.NET CLI will be downloaded from https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0-beta-002173/dotnet-dev-ubuntu-x64.1.0.0-beta-002173.tar.gz
Locating /home/david/git/coreclr/Tools/1.0.25-prerelease-00308-04/project.json to see if we already downloaded .NET CLI tools...
/home/david/git/coreclr/Tools/1.0.25-prerelease-00308-04/project.json not found. Proceeding to download .NET CLI tools. 
curl -sSL --create-dirs -o /home/david/git/coreclr/Tools/dotnetcli/dotnet.tar https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0-beta-002173/dotnet-dev-ubuntu-x64.1.0.0-beta-002173.tar.gz
Unsupported Linux distribution 'arch' detected. Downloading ubuntu-x64 tools.
Failed to initialize CoreCLR, HRESULT: 0x80131500
Failed to initialize CoreCLR, HRESULT: 0x80131500
chmod: cannot access '/home/david/git/coreclr/Tools/corerun': No such file or directory
mkdir: cannot create directory '/home/david/git/coreclr/packages/Microsoft.DotNet.BuildTools/1.0.25-prerelease-00308-04/lib/portableTargets': File exists
Failed to initialize CoreCLR, HRESULT: 0x80131500
cp: cannot stat '/home/david/git/coreclr/Tools/corerun': No such file or directory
mv: cannot stat '/home/david/git/coreclr/Tools/Microsoft.CSharp.targets': No such file or directory
chmod: cannot access '/home/david/git/coreclr/Tools/corerun': No such file or directory
Failed to restore BuildTools.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The interesting line here is &lt;code class=&quot;highlighter-rouge&quot;&gt;Failed to initialize CoreCLR, HRESULT: 0x80131500&lt;/code&gt;. It look like something in the init-tools.sh is throwing this error. By putting some trace in the file I found that it’s the line which is calling “dotnet” which throw the error.  Looking online or on the github issue of the project I couldn’t find anything useful.&lt;/p&gt;

&lt;h1 id=&quot;coreclr-build-process&quot;&gt;CoreClr Build process&lt;/h1&gt;
&lt;p&gt;As I started to look around to understand what was happening there and looking at the build script. &lt;code class=&quot;highlighter-rouge&quot;&gt;build.sh&lt;/code&gt; is calling &lt;code class=&quot;highlighter-rouge&quot;&gt;init-tools.sh&lt;/code&gt;. The script ‘init-tools.sh’ is downloading from a remote server the package of &lt;a href=&quot;https://github.com/dotnet/cli&quot;&gt;.Net cli&lt;/a&gt; (.Net core Command LIne) which is a new tool that allow to create, build and run .Net code.
The dotnetcli is used to download the dependency that mscorelib has from Nuget. The stepm that call &lt;code class=&quot;highlighter-rouge&quot;&gt;dotnet restore&lt;/code&gt; is failing with the above error. The most basic command you can run is &lt;code class=&quot;highlighter-rouge&quot;&gt;dotnet --version&lt;/code&gt; which doesn’t run anything and should just return the current version of the tool. Unfortunately this simple version if failing with the same error. 
Looking at the script you can see that it’s downloading a specific version of dotnetcli depending on the Linux distribution you are on, and it’s the distribution cannot be found it will use the package for the ubuntu 14.04&lt;/p&gt;

&lt;h1 id=&quot;investigation-the-error&quot;&gt;Investigation the error&lt;/h1&gt;
&lt;p&gt;The experience told me that the problem we have is related to missing dependency. On windows I would use a tool like &lt;a href=&quot;https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx&quot;&gt;procmon&lt;/a&gt; which allow to monitor all the input/output of the process. Luckily Linux has an equivalent tool named ‘strace’. I found this great &lt;a href=&quot;http://www.danielhall.me/tag/strace/&quot;&gt;tutorial&lt;/a&gt; from Daniel Hall that explain the basic about the information you can find in the file.
The &lt;code class=&quot;highlighter-rouge&quot;&gt;dotnet&lt;/code&gt; executable is downloaded into the child folder ‘Tools/dotnetcli’. We just have to go to the pass and start strace&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;Tools/dotnetcli
strace &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; dotnet.log ./dotnet &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The command above saved the log to the file ‘dotnet.log’ which will we have to investigate now ;-)
Looking inside of the file, the first think we have to look at is for “(No such file or directory)” pattern which inform us about potential missing dependency. In our case one of the recurrent error is the following.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;open(&quot;/usr/lib/libicuuc.so.52&quot;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which show us that we are missing the library “icu”. But wait…. We installed that on the previous post, so how come. It’s time to check what I have in the folder “&lt;em&gt;/usr/lib&lt;/em&gt;”.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;david@dc-archlinux-1 coreclr]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ali&lt;/span&gt; /usr/lib/libicu&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
162387 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicudata.so -&amp;gt; libicudata.so.57.1
162370 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicudata.so.57 -&amp;gt; libicudata.so.57.1
162391 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root 25674392 Apr  2 15:18 /usr/lib/libicudata.so.57.1
162389 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicui18n.so -&amp;gt; libicui18n.so.57.1
162368 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicui18n.so.57 -&amp;gt; libicui18n.so.57.1
162375 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root  2591776 Apr  2 15:18 /usr/lib/libicui18n.so.57.1
162378 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicuio.so -&amp;gt; libicuio.so.57.1
162374 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicuio.so.57 -&amp;gt; libicuio.so.57.1
162385 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root    56008 Apr  2 15:18 /usr/lib/libicuio.so.57.1
162390 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicule.so -&amp;gt; libicule.so.57.1
162379 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicule.so.57 -&amp;gt; libicule.so.57.1
162371 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root   354544 Apr  2 15:18 /usr/lib/libicule.so.57.1
162381 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libiculx.so -&amp;gt; libiculx.so.57.1
162376 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libiculx.so.57 -&amp;gt; libiculx.so.57.1
162377 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root    51640 Apr  2 15:18 /usr/lib/libiculx.so.57.1
162372 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicutest.so -&amp;gt; libicutest.so.57.1
162373 lrwxrwxrwx 1 root root       18 Apr  2 15:18 /usr/lib/libicutest.so.57 -&amp;gt; libicutest.so.57.1
162369 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root    65760 Apr  2 15:18 /usr/lib/libicutest.so.57.1
162386 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicutu.so -&amp;gt; libicutu.so.57.1
162388 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicutu.so.57 -&amp;gt; libicutu.so.57.1
162380 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root   201240 Apr  2 15:18 /usr/lib/libicutu.so.57.1
162384 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicuuc.so -&amp;gt; libicuuc.so.57.1
162382 lrwxrwxrwx 1 root root       16 Apr  2 15:18 /usr/lib/libicuuc.so.57 -&amp;gt; libicuuc.so.57.1
162383 &lt;span class=&quot;nt&quot;&gt;-rwxr-xr-x&lt;/span&gt; 1 root root  1727160 Apr  2 15:18 /usr/lib/libicuuc.so.57.1

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bingo&lt;/strong&gt;
Look like ArchLinux installed the latest version of the “icu” library which is 57 whereas Ubuntu 14.04 which is the server that has build the package only support the version 52 of icu. So now that we know what is what is the missing dependency it’s time to look at what is our library that is calling it. Checking few line above in the log file I can find that “&lt;em&gt;System.Globalization.Native.so&lt;/em&gt;” is looking for that dependency. Thinking more about it this relation make sense as icu stand for “International Component for Unicode” and would be required for the globalization component of CoreClr.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;open(&quot;/home/david/git/coreclr/Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.0-rc2-23931/System.Globalization.Native.so&quot;, O_RDONLY|O_CLOEXEC) = 12
read(12, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\240F\0\0\0\0\0\0&quot;..., 832) = 832
fstat(12, {st_mode=S_IFREG|0755, st_size=56944, ...}) = 0
mmap(NULL, 2151880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 12, 0) = 0x7f57099f3000
mprotect(0x7f5709a00000, 2093056, PROT_NONE) = 0
mmap(0x7f5709bff000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 12, 0xc000) = 0x7f5709bff000
close(12)                               = 0
open(&quot;/etc/ld.so.cache&quot;, O_RDONLY|O_CLOEXEC) = 12
fstat(12, {st_mode=S_IFREG|0644, st_size=48486, ...}) = 0
mmap(NULL, 48486, PROT_READ, MAP_PRIVATE, 12, 0) = 0x7f5798020000
close(12)                               = 0
open(&quot;/usr/lib/libicuuc.so.52&quot;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
munmap(0x7f5798020000, 48486)           = 0
munmap(0x7f57099f3000, 2151880)         = 0
open(&quot;/etc/ld.so.cache&quot;, O_RDONLY|O_CLOEXEC) = 12
fstat(12, {st_mode=S_IFREG|0644, st_size=48486, ...}) = 0
mmap(NULL, 48486, PROT_READ, MAP_PRIVATE, 12, 0) = 0x7f5798020000
close(12)                               = 0
open(&quot;/usr/lib/System.Globalization.Native.so&quot;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
munmap(0x7f5798020000, 48486)           = 0

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Looking more into this problem, I found that linux has a command line that allow you to check for a given module the dependency and that they are present. The command line is &lt;a href=&quot;http://man7.org/linux/man-pages/man1/ldd.1.html&quot;&gt;ldd&lt;/a&gt; which allow to print the object dependencies. Running this command on the &lt;code class=&quot;highlighter-rouge&quot;&gt;System.Globalization.Native.so&lt;/code&gt; give us the following result.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[david@dc-archlinux-1 coreclr]$ ldd Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.0-rc2-23931/System.Globalization.Native.so 
        linux-vdso.so.1 (0x00007ffe8057d000)
        libicuuc.so.52 =&amp;gt; not found
        libicui18n.so.52 =&amp;gt; not found
        libstdc++.so.6 =&amp;gt; /usr/lib/libstdc++.so.6 (0x00007f04c84b1000)
        libm.so.6 =&amp;gt; /usr/lib/libm.so.6 (0x00007f04c81ac000)
        libgcc_s.so.1 =&amp;gt; /usr/lib/libgcc_s.so.1 (0x00007f04c7f96000)
        libc.so.6 =&amp;gt; /usr/lib/libc.so.6 (0x00007f04c7bf4000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x0000557cb89c6000)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One more time we can see that the module libicu are missing for the version 52 in this case.&lt;/p&gt;

&lt;h1 id=&quot;solutions&quot;&gt;Solutions&lt;/h1&gt;
&lt;p&gt;I found two solution that allow to resolve the problem of the ICU dependency failure&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Downgrade ArchLinux ICU package installed to the version 52&lt;/li&gt;
  &lt;li&gt;Use the Native version of System.Globalization.Native.so build on the machine&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;downgrading-icu-to-the-version-52&quot;&gt;Downgrading ICU to the version 52&lt;/h2&gt;
&lt;p&gt;Pacman that ArchLinux package manager has an archive website that you can use to find historical packages. You can browse this &lt;a href=&quot;https://archive.archlinux.org/packages/&quot;&gt;link&lt;/a&gt; to look at the package you are looking at. In our case we are interested to find the &lt;a href=&quot;https://archive.archlinux.org/packages/i/icu/&quot;&gt;icu&lt;/a&gt;. When you have the package you want you can run pacman with the option -U to install it. In our case we want to install ICU version 52 for x64 the command line will be&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-U&lt;/span&gt; https://archive.archlinux.org/packages/i/icu/icu-52.1-1-x86_64.pkg.tar.xz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and running again ldd show us that time&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;david@dc-archlinux-1 coreclr]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ldd Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.0-rc2-23931/System.Globalization.Native.so 
        linux-vdso.so.1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007fffbbf9e000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicuuc.so.52 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicuuc.so.52 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf71ae000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicui18n.so.52 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicui18n.so.52 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf6da6000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libstdc++.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libstdc++.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf6a23000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libm.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libm.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf671e000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libgcc_s.so.1 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libgcc_s.so.1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf6508000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libc.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libc.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf6166000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicudata.so.52 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicudata.so.52 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf48fb000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libpthread.so.0 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libpthread.so.0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf46de000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libdl.so.2 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libdl.so.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007f0cf44d9000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        /usr/lib64/ld-linux-x86-64.so.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x0000561b5e424000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Look like downgrading made dotnet dependency problem going away. However this has some other implication because other software are depending on that library and are now starting to fail as well. Time too look at the option 2.&lt;/p&gt;

&lt;h2 id=&quot;copying-the-native-lib-build-on-the-machine&quot;&gt;Copying the Native lib build on the machine&lt;/h2&gt;
&lt;p&gt;Before doing that you need to be sure your system is update to date by running &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo pacman -Syu&lt;/code&gt; and building coreclr using &lt;code class=&quot;highlighter-rouge&quot;&gt;./build.sh clean skipmscorlib&lt;/code&gt;. When you are done with that tasks, you can look at copying the freshly build “System.Globalization.Native.so” to the folder where &lt;code class=&quot;highlighter-rouge&quot;&gt;dotnet&lt;/code&gt; is picking it.
We can now see that we have a dependency with ICU version 57 present in the machine.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;david@dc-archlinux-1 coreclr]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ldd bin/Product/Linux.x64.Debug/System.Globalization.Native.so 
        linux-vdso.so.1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007ffffe3d9000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicuuc.so.57 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicuuc.so.57 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb90e9a000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicui18n.so.57 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicui18n.so.57 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb90a20000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libstdc++.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libstdc++.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb9069d000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libm.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libm.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb90398000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libgcc_s.so.1 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libgcc_s.so.1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb90182000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libc.so.6 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libc.so.6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb8fde0000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libicudata.so.57 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libicudata.so.57 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb8e364000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libpthread.so.0 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libpthread.so.0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb8e147000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        libdl.so.2 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; /usr/lib/libdl.so.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00007feb8df42000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        /usr/lib64/ld-linux-x86-64.so.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00005569e3704000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;either of the above solution help to produce the expected result… Just getting the version of the dotnet exec&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;david@dc-archlinux-1 coreclr]&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;Tools/dotnetcli/dotnet &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;                             
1.0.0-beta-002173

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;This was a first good initiation at how to use and check dependency problem in Linux. We found some solution that allow to temporary fix the problem and we will look in a later article about a proper way to address that. Even that fix the first error, dotnet still have problem when we try to restore the package from nuget related this time about the network which I will show how to fix in the next post.
So far just building CoreClr on ArchLinux prove to be more challenging than I expected and make me go inside to understand the process better. I cannot find better introduction.&lt;/p&gt;

&lt;p&gt;This library is written in C# and required a .Net Csharp compiler. In 2015 this step was done using the Mono .Net runtime&lt;/p&gt;
</description>
        <pubDate>Fri, 29 Apr 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/04/29/CoreClr-Problem-With-ICU-Dependency-On-ArchLinux/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/04/29/CoreClr-Problem-With-ICU-Dependency-On-ArchLinux/</guid>
        
        <category>Archlinux,</category>
        
        <category>CoreCRL,</category>
        
        <category>UCI</category>
        
        
        <category>Archlinux,</category>
        
        <category>CoreCRL</category>
        
      </item>
    
      <item>
        <title>Building CoreCRL on ArchLinux</title>
        <description>&lt;p&gt;In this post I will show you how to build the open source project .Net &lt;a href=&quot;https://github.com/dotnet/coreclr&quot;&gt;CoreClr&lt;/a&gt; to Archlinux. This is not a distribution that is supported by default, however the build is working following some simple step.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;WARNING: You can only build the Coreclr today on Linux for the following cpu Intel x64, Arm32 and Arm64.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because the laptop that I’m using is a 32 bits CPU, I choose to build a 64 bits VM on DigitalOcean to do all this development. Setting up the Arch Linux VM on DigitalOcean will be in another article. You need as well to ensure that your system (virtual or physical) has at least 1GB of RAM. This is a requirement to build the CoreCRL.&lt;/p&gt;

&lt;h1 id=&quot;package-requirement&quot;&gt;Package requirement&lt;/h1&gt;

&lt;p&gt;The CoreCRL wiki has a page that give you the instruction about about the &lt;a href=&quot;https://github.com/davzucky/coreclr/blob/master/Documentation/building/linux-instructions.md&quot;&gt;How to Build CoreCRL on Linux&lt;/a&gt;. This is great, however the list of package are not matching one for one with the ArchLinux package naned.&lt;/p&gt;

&lt;h2 id=&quot;package-manager&quot;&gt;Package Manager&lt;/h2&gt;
&lt;p&gt;Pacman doesn’t contain all the required package that we need so we need to have another package manager that allow to install non official package. In my case I choose ‘yaourt’. The instruction to install ‘yaourt’ are available &lt;a href=&quot;https://archlinux.fr/yaourt-en&quot;&gt;here&lt;/a&gt; and are strait forward.&lt;/p&gt;

&lt;h2 id=&quot;package-installation&quot;&gt;Package Installation&lt;/h2&gt;

&lt;p&gt;The command list the package to install and the package manager you need to use&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; cmake llvm clang35 python icu
yaourt &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; python2 lldb libunwind liblttng-ust-python-agent
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;building-corecrl&quot;&gt;Building CoreCRL&lt;/h1&gt;
&lt;p&gt;We now have all the required package on our machine and we can start to look at extracting the code and building it.&lt;/p&gt;

&lt;h2 id=&quot;extracting-the-code&quot;&gt;Extracting the code&lt;/h2&gt;
&lt;p&gt;The first step you have to do is to fork the &lt;a href=&quot;https://github.com/dotnet/coreclr/&quot;&gt;CoreCRL githib&lt;/a&gt;  repository to your github account. 
When you are done with that clone, the repository to your local machine. In my case all the git repo are cloned under the folder ‘~/git’&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://gihbub.com/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;MyGitRepoName&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;/coreclr.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;build-the-code&quot;&gt;Build the code&lt;/h2&gt;
&lt;p&gt;We have the code on our local repository so we can build the code now. Go to the folder &lt;em&gt;corecrl&lt;/em&gt; and type the command&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./build.sh x64 Debug clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can now wait for sometime as the source code is quite big to build.&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;After so failure to build CoreCRL on x86 which is not supported on Linux at the moment, I have been able to build it on x64 after finding all the dependency that are required. In the next post I will look at how to build CoreFX which contain the base .Net library.&lt;/p&gt;

&lt;h2 id=&quot;update-20-april-2016&quot;&gt;Update 20 April 2016&lt;/h2&gt;
&lt;p&gt;The instruction above are good, and allow to build all the native library of the coreclr, however you cannot build mscorelib because it rely on an external package that we download and which has been build using older base library than the one we have on ArchLinux. 
You will be able to find more information on a latest post.&lt;/p&gt;
</description>
        <pubDate>Fri, 08 Apr 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/04/08/Building-CoreClr-On-ArchLinux/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/04/08/Building-CoreClr-On-ArchLinux/</guid>
        
        <category>Archlinux,</category>
        
        <category>CoreCRL</category>
        
        
        <category>Archlinux,</category>
        
        <category>CoreCRL</category>
        
      </item>
    
      <item>
        <title>Archlinux Setup X</title>
        <description>&lt;p&gt;Now we have a base installation of Linux, however we are still missing one important component. The Windows manager. Archlinux let you choose the Windows Manager and display manager you want to install on your machine. The ones I chose are :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Windows Manager : xmonad&lt;/li&gt;
  &lt;li&gt;Display Manager : lightdm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reason I chose the above is that they are enough light to run on this machine and allow to control everything using the keyboard only.&lt;/p&gt;

&lt;h1 id=&quot;windows-manager-vs-display-manager&quot;&gt;Windows Manager vs Display Manager&lt;/h1&gt;
&lt;p&gt;Before starting the installation I want to summarize my understanding about the difference between Windows Manager and the Display Manager.
One of the best answer are from the following &lt;a href=&quot;http://unix.stackexchange.com/questions/20385/windows-managers-vs-login-managers-vs-display-managers-vs-desktop-environment&quot;&gt;stackoverflow question&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Display  Manager 
 &lt;em&gt;A login manager is a synonym. This is the first X program run by the system if the system (not the user) is starting X and allows you to log on to the local system, or network systems.&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Windows Manager
 &lt;em&gt;A window manager controls the placement and decoration of windows. That is, the window border and controls are the decoration. Some of these are stand alone (WindowMaker, sawfish, fvwm, etc). Some depend on an accompanying desktop environment.&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;installing-xmonad&quot;&gt;Installing xmonad&lt;/h1&gt;
&lt;p&gt;xmonad is a tilling windows manager. This mean that the windows are automatically disposed for you to maximized the most they can the desktop. All the windows disposition are control using only the keyboard without the need of the mouse.
The program is written on haskell and you configure it as well using haskell.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/pictures_L.png&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-21-ArchLinux-Setting-X/desktop_S.png&quot; alt=&quot;desktop sample&quot; /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;h2 id=&quot;installation-of-xmonad&quot;&gt;Installation of xmonad&lt;/h2&gt;
&lt;p&gt;The installation of the windows manager xmonad has some dependency on  &lt;a href=&quot;https://en.wikipedia.org/wiki/X_Window_System&quot;&gt;X-windows&lt;/a&gt;  which is basic framework for GUI in linux. We will install all of that at the same time as xmonad.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; xorg xorg-xinit xmonad xmonad-contrib xterm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At this point we have xmonad install. We need to check now that it’s working as expected. To do that, we need to create a named .xinitrc in your root profile that will start xmonad.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Create a file using &lt;em&gt;vim ~/.xinitrc&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;write inside &lt;em&gt;exec xmonad&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;save and close using *:wq”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We just that to run in the shell the command startx now. What you should see at that point is a black screen. This is not really useful. Using your keyboard type “Ctrl+Atl+Enter”, this magic command should launch for you xterm. If you are able to see that, congratulation you have install the basic of xmonad.&lt;/p&gt;

&lt;h2 id=&quot;personalizing-xmonad&quot;&gt;Personalizing xmonad&lt;/h2&gt;
&lt;p&gt;I will leave point you to that link which I used to customized xmonad. This is really useful and contain all the information you are looking for.&lt;/p&gt;

&lt;h1 id=&quot;installing-lightdm&quot;&gt;Installing lightdm&lt;/h1&gt;
&lt;p&gt;if you arrive here, that mean you have setup xmonad and are able not to use it running &lt;em&gt;startx&lt;/em&gt;. We can know install and setup lightdm as a display manager service. We will install with lightdm the default gtk greeter.&lt;/p&gt;

&lt;p&gt;The installation is as simple as installing a pacman package and enabling the service to start at boot.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; lightdm lightdm-gtk-greeter
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;lightdm.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And you are done. reboot your machone and you will be able to see the following at startup now&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;This was quite simple and nice to get now a multi windows environment that we can control only with the keyboard. This is mile away from the ms-Windows that people know, however this minimal design make it as well less noisy and allow you to focus more on your work.&lt;/p&gt;

</description>
        <pubDate>Mon, 21 Mar 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/03/21/ArchLinux-Setting-X/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/03/21/ArchLinux-Setting-X/</guid>
        
        <category>Archlinux,</category>
        
        <category>xmonad,</category>
        
        <category>lightdm</category>
        
        
        <category>Archlinux,</category>
        
        <category>xmonad</category>
        
      </item>
    
      <item>
        <title>EeePC 1101HA Change HD to SSD</title>
        <description>&lt;p&gt;After a week without post because it took longer than I expect to reinstall ArchLinux to the state I wanted. I’m finally back online.
In this post I show you how to change the SSD of an old EeePc 1101HA laptop to an SSD. I choose to do that now because of the hibernation hybrid mode I want to enable and as well because the price of a new SSD of 128GB is only 320 HKD (~40 USD).
I choose for the SSD a Kingston SSDNow 300 of 128GB. This is one of the cheapest model you can find today on the market. The interface is SATA3, which is true is far more powerfull than the machine. it’s sure that won’t be the bottleneck here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;The procedure below will break the warranty of your machine ( which should have expired already anyway )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;before-starting&quot;&gt;Before Starting&lt;/h1&gt;

&lt;h2 id=&quot;tool-requirement&quot;&gt;Tool requirement&lt;/h2&gt;
&lt;p&gt;The tools you need for this procedure are quite standard:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Small philips screw driver&lt;/li&gt;
  &lt;li&gt;Flat screw driver&lt;/li&gt;
  &lt;li&gt;credit card ( Yes I know can sound strange )&lt;/li&gt;
  &lt;li&gt;New SSD&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;todo&quot;&gt;Todo&lt;/h2&gt;
&lt;p&gt;Be sure you are backed up your machine before starting this process.&lt;/p&gt;

&lt;h1 id=&quot;instructions&quot;&gt;Instructions&lt;/h1&gt;

&lt;h2 id=&quot;removing-the-battery&quot;&gt;Removing the battery&lt;/h2&gt;
&lt;p&gt;Turn your laptop and remove the battery using the right and left buttom.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-1-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-1-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;empty-the-laptop-remaining-energy&quot;&gt;Empty the Laptop remaining energy&lt;/h2&gt;
&lt;p&gt;You need to press the start buttom for 5s to ensure that no more power is in the laptop&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-2-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-2-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;removing-the-ram-and-unscrew-the-back-screw&quot;&gt;Removing the RAM and unscrew the back screw&lt;/h2&gt;
&lt;p&gt;Turn the laptop again and open the hash where the RAM is located and remove it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-3-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-3-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unscrew the 8 screws on the back.&lt;/p&gt;

&lt;h2 id=&quot;removing-the-keyboard&quot;&gt;Removing the keyboard&lt;/h2&gt;
&lt;p&gt;Return the laptop and open the cover. We will remove the keyboard to be able to access the remaining screw to access the heart of the laptop. Removing the keyboard is not hard. You will need a flat screw driver to be able remove the keyboard.
The keyboard is attached to the case by for pin located above the letter ‘&lt;em&gt;ESC&lt;/em&gt;’, ‘&lt;em&gt;F5&lt;/em&gt;’, ‘&lt;em&gt;F11&lt;/em&gt;’ and ‘&lt;em&gt;Delete&lt;/em&gt;’ (for US keyboard). Place the screw driver in the small space and press again you. You can see from the below picture how to put the screw driver&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-4-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-4-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you pushed out the four link you will have the keyboard coming out. &lt;strong&gt;Don’t Pull It Out&lt;/strong&gt;. The keyboard is still attached to the base and we need to remove that. Use a small screw driver and push on the motherboard on each side of where the cable is connected. When you did that remove it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-5-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-5-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;removing-the-top-cover&quot;&gt;Removing the top cover&lt;/h2&gt;
&lt;p&gt;The next step to access the motherboard and the hard drive is to remove the top cover. We will need to remove 8 more screw and use a credit card to pass in the edge to remove the cover.
Under where the keyboard was located, remove the 8 screws. One of the screw is hidden behind the small sticker saying that you will lost the warranty on the laptop (Which for a 7 years is not important)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-6-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-6-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we start removing the cover we have to unplug the trackpack from the motherboard. On the bottom of where the keyboard was located they are a cable with which you can remove. Use a small screw driver to push up the motherboard link and remove the cable. We don’t have anything that link the cover to the motherboard anymore.&lt;/p&gt;

&lt;p&gt;Use a credit card to pass in the edge of the laptop and remove the cover as per the picture below.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-7-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-7-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;removing-the-hard-drive&quot;&gt;Removing the Hard drive&lt;/h2&gt;
&lt;p&gt;You can now see all the heart of the laptop. The hard drive is located under the connecting cable that run between the motherboard and the extension card. We need to remove that first before we can access physically to the hard drive.&lt;/p&gt;

&lt;p&gt;The nap can be remove my pulling up in each extremity the plug. it will turn by 90 degres and you will be able to remove the link which will free up the hard drive.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-8-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-8-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We just have to remove one screw to be able to remove the hard drive. A small strip on the left is here to allow to pull the hard drive from the connector.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-9-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-9-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;replacing-the-hard-drive-with-the-ssd&quot;&gt;Replacing the Hard drive with the SSD&lt;/h2&gt;
&lt;p&gt;This is the last step before we can reassamble the laptop. We need to remove 4 screws from case that hold the hard drive and replace it with the SSD. We need to be sure to put the new SSD in the right side.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-10-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-10-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;
View of the Hard drive in the case&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-11-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-11-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;
View of the case and SSD side by side&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-12-L.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/posts/2016-03-12-EeePc-1101HA-SSD-Update/EeePc-SSD-12-S.jpg&quot; alt=&quot;EeePC Back Laptop&quot; /&gt;&lt;/a&gt;
VIew of the SSD in the case&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;Changing the hard drive with this laptop was more challenging than I though but not that hard. I’m too use to having hard drive that are simple to access.
The total time to do that is around 15 mins when you know what you are doing.&lt;/p&gt;

&lt;p&gt;I hope that some poeple like me who still own some of this old machine will find this instruction usefull&lt;/p&gt;
</description>
        <pubDate>Sat, 12 Mar 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/03/12/EeePc-1101HA-SSD-Update/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/03/12/EeePc-1101HA-SSD-Update/</guid>
        
        <category>SSD,</category>
        
        <category>EeePc</category>
        
        <category>1101HA</category>
        
        
        <category>Hardware,</category>
        
        <category>EeePc</category>
        
      </item>
    
      <item>
        <title>Archlinux enabling hibernation</title>
        <description>&lt;p&gt;It’s now time to look at how to enable hibernation to a swapfile when we close the lid of the laptop. As a non Linux expert, it took me some time and some failure to arrive at the expect comfiguration. I didn’t want to use any helper script and wanted to setup everything using &lt;em&gt;systemd&lt;/em&gt;. I want to enable hibernation because I want to have the ability to restart where I left the system without  consuming energy. It’s true that restarting the computer will be slower, however this is a compromise that I accept.&lt;/p&gt;

&lt;p&gt;The detailed instructions from the ArchLinux can be found below.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/Power_management&quot;&gt;Arch linux - Power management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate&quot;&gt;Arch linux - Power management/suspend and hibernate&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/Swap#Swap_file_resuming&quot;&gt;Arch linux - Swap&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/GRUB#Generate_the_main_configuration_file&quot;&gt;Arch Linux - Grub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;setting-up-hibernate-mode&quot;&gt;Setting up Hibernate mode.&lt;/h1&gt;
&lt;p&gt;In this section I will cover how to setup your ArchLinux to use a file swap to hibernate. This require a few change in the way we are starting the kernel as well as some subtility with the creation of this file. So let start.&lt;/p&gt;

&lt;h2 id=&quot;creating-a-swap-file&quot;&gt;Creating a swap file&lt;/h2&gt;

&lt;h3 id=&quot;create-a-new-swapfile&quot;&gt;Create a new swapfile&lt;/h3&gt;
&lt;p&gt;Allocating the file is quite simple with the command &lt;em&gt;fallocate&lt;/em&gt;, but before we can do that we need to have an idea about how much memory we need to allocate. The recommendation is 2/5 of the total RAM available on your machine. This is good to know, however how can I quantify that. Luckily for us they are a file &lt;em&gt;/sys/power/image_size&lt;/em&gt; which containt the information we are looking for. You can read the content of the file using the command &lt;em&gt;cat&lt;/em&gt;. The size required for my system is 840889812 bytes which equivalent at ~841MB. So the comment to run in my case is to create the file &lt;em&gt;/swapfile&lt;/em&gt; of 841MB is:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;fallocate &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 841M /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;change-the-permission-of-the-new-swapfile&quot;&gt;Change the permission of the new swapfile&lt;/h3&gt;
&lt;p&gt;The swap file could be a big hole in for your security. The first think we have to do is to remove any access to non &lt;em&gt;root&lt;/em&gt; users but keet r/w to &lt;em&gt;root&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;chmod 600 /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;format-the-swap-file&quot;&gt;Format the swap file&lt;/h3&gt;
&lt;p&gt;Before been able to use it, we need to format it. Same as when when create the system we have to use the command &lt;em&gt;mkswap&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mkswap /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;enable-the-swap-file&quot;&gt;Enable the swap file&lt;/h3&gt;
&lt;p&gt;Same as when we installed archlinux, we have to enable the new swap file in the system with the command &lt;em&gt;swapon&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;swapon /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;add-new-swap-file-entry-into-etcfstab&quot;&gt;Add new swap file entry into &lt;em&gt;/etc/fstab&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;Edit the file &lt;em&gt;/etc/fstab&lt;/em&gt; and add the following file. This discribe the information about how to mount the new swap file as a file system&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/swapfile none swap defaults 0 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The content of your file should look like 
&lt;img src=&quot;/assets/posts/2016-02-22-ArchLinux-Powermanagement-Setting-Hibernate/fstab.png&quot; alt=&quot;fstab&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Great, We have a new swap partition which is just a simple file. We will use that to enable the hibernation to happen.&lt;/p&gt;

&lt;h2 id=&quot;update-the-kernel-startup-parameter-using-grub&quot;&gt;Update the kernel startup parameter using grub&lt;/h2&gt;
&lt;p&gt;We have to pass two news arguments to the startup kernel.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;resume&lt;/strong&gt; : Give to the kernel the drive that contain the hibernate swap. This parameter is enough alone if you are not using a file swap&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;resume_offset&lt;/strong&gt; : Inform the kernel the offset for the start of the swap file on the partition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As we are using grub as our bootloader we will update it’s configuration to start the kernel with this flag&lt;/p&gt;

&lt;h3 id=&quot;open-etcdefaultgrub&quot;&gt;Open /etc/default/grub&lt;/h3&gt;

&lt;h3 id=&quot;add-parameter-resume&quot;&gt;Add parameter &lt;em&gt;resume&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;In the command line XXX of the file we need to add the parameter resume with the drive name that contain our swap file. In the case of my machine this file is located on the drive /dev/sda2. The parameter to is&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;resume=/dev/sda2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;add-parameter-resume_offset&quot;&gt;Add parameter &lt;em&gt;resume_offset&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;Before adding this paramter we need to find the value we need for the offset. The simpliest solution using build in command is running the following command&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;filefrag &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; /swapfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result of the command should look like that
&lt;img src=&quot;/assets/posts/2016-02-22-ArchLinux-Powermanagement-Setting-Hibernate/filefrag.png&quot; alt=&quot;filefrag result&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The value we want is from the first row the column &lt;em&gt;physical_offset&lt;/em&gt;. In my case 79872. Now that we have this value we need to add this parameter to our startup kernel&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;resume_offset=79872
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;generating-the-new-grubcfg-configuration-file&quot;&gt;Generating the new grub.cfg configuration file&lt;/h3&gt;
&lt;p&gt;This can be simply done using the command line tool &lt;em&gt;grub-mkconfig&lt;/em&gt; with the option of the location for the output file.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;grub-mkconfig &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /boot/grub/grub.cfg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;update-mkinitcpio&quot;&gt;Update mkinitcpio&lt;/h2&gt;
&lt;p&gt;‘&lt;em&gt;mkinitcpio&lt;/em&gt; is a batsh script that create an initial ramdisk environment’. You can find more information &lt;a href=&quot;https://wiki.archlinux.org/index.php/mkinitcpio&quot;&gt;mkinitcpio&lt;/a&gt;.
We need to update the startup hook to add the resume one. This will ensure that the system can restore from the hibernation.&lt;/p&gt;

&lt;h3 id=&quot;add-resume-hook-to-etcmkinitcpioconf&quot;&gt;Add resume hook to /etc/mkinitcpio.conf&lt;/h3&gt;
&lt;p&gt;We have to edit in the file &lt;em&gt;/etc/mkinitcpio.conf&lt;/em&gt; the section &lt;em&gt;HOOK&lt;/em&gt;. This section control the module that are been loaded into the image at boot time. You need to add in the set of argument there the &lt;em&gt;resume&lt;/em&gt; one.&lt;/p&gt;

&lt;p&gt;For example my current section is looking like that.
&lt;img src=&quot;/assets/posts/2016-02-22-ArchLinux-Powermanagement-Setting-Hibernate/mkinitcpio_hook.png&quot; alt=&quot;mkinitcpio Hooks&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;generate-the-images&quot;&gt;Generate the images&lt;/h3&gt;
&lt;p&gt;The command we need to use to generate this boot image is &lt;em&gt;mkinitcpio&lt;/em&gt;. The default setup is reading the information from the configuration file &lt;em&gt;/etc/mkinitcpio.conf&lt;/em&gt;. As we want to generate the base image for in the default ArchLinux path we can use the option &lt;em&gt;-p&lt;/em&gt;. The command we have to run on elevated mode is.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mkinitcpio &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; linux
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;enable-systemd-handle&quot;&gt;Enable systemd handle&lt;/h2&gt;
&lt;p&gt;They are multiple solution to enable the handle abd choose the right behavior. You can find more information there &lt;a href=&quot;&quot;&gt;&lt;/a&gt;. The solution I choose is the drive the handle action using the &lt;em&gt;systemd&lt;/em&gt; as the base. The configuration of the handles can be find in the configuration file &lt;em&gt;/etc/systemd/logind.conf&lt;/em&gt;. The handles we want to set are :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;HandleLidSwitch : Action when we close the lid of the laptop&lt;/li&gt;
  &lt;li&gt;IdleAction : Action taken after the idle event is raised&lt;/li&gt;
  &lt;li&gt;IdleActionSec : Time before the idle event is raised&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I want is the laptop to go on hibernate mode by default for the two event above. I’m more worried about battery than starting time (Which is not the slow anyway compare to Windows ). We just have to put for this event the value &lt;em&gt;hibernate&lt;/em&gt; and we will be in the right state.&lt;/p&gt;

&lt;h1 id=&quot;next-step-and-summary&quot;&gt;Next step and summary&lt;/h1&gt;

&lt;p&gt;I’m happy with where I finish, however I want to do the next step which is mixing &lt;em&gt;suspend&lt;/em&gt; and &lt;em&gt;hibernate&lt;/em&gt;, so I will do a quick hardware update and reinstall my machine after changing the hard drive to an SSD. With today cost of ~300 HKD (~40 USD), this will be a good one. The advantage of having an SSD will be that I won’t have to worried about the laptop waking up during transport to hibernate. I will have to restart my base install and check what specific setting I need for SSD.&lt;/p&gt;

&lt;p&gt;So next step. How to change the hard drive of the EEEPC 1101HA to an SSD&lt;/p&gt;
</description>
        <pubDate>Mon, 22 Feb 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/02/22/ArchLinux-Powermanagement-Setting-Hibernate/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/02/22/ArchLinux-Powermanagement-Setting-Hibernate/</guid>
        
        <category>Archlinux,</category>
        
        <category>PowerManagement</category>
        
        
        <category>Archlinux</category>
        
      </item>
    
      <item>
        <title>ArchLinux - Using netctl to setup the network</title>
        <description>&lt;p&gt;For this article we will focus on network setup (at least what I’ve found so far) and will look at some of the useful commands that I now use often.&lt;/p&gt;

&lt;p&gt;Setting up the network, and more specifically the wifi can be traumatic. However, even without X windows there are some nice simple tools to help you to setup the wifi connection (like ‘wifi-menu’ that we used earlier).&lt;/p&gt;

&lt;p&gt;If you follow the step to set up the base installation from this &lt;a href=&quot;Need to define&quot;&gt;article&lt;/a&gt;, you should already have from your base installation the packages &lt;a href=&quot;https://wiki.archlinux.org/index.php/netctl&quot;&gt;netctl&lt;/a&gt; and &lt;a href=&quot;http://linuxcommand.org/lc3_adv_dialog.php&quot;&gt;dialog&lt;/a&gt;. &lt;em&gt;netctl&lt;/em&gt; is a batch script built on top of systemctl that allows you to start or stop the network profile configuration service.&lt;/p&gt;

&lt;h1 id=&quot;connecting-manually&quot;&gt;Connecting Manually&lt;/h1&gt;

&lt;p&gt;Before trying to connect using some auto detection, it would be good to understand what is happening under the hood. &lt;em&gt;netctl&lt;/em&gt; is a simple command that allow you to list available profiles, start a profile or stop a profile. In this section we will first look at how to setup a wired connection followed by a wifi one, and then get a quick overview of the netctl command line tool.&lt;/p&gt;

&lt;h2 id=&quot;setting-up-an-ethernet-profile&quot;&gt;Setting up an Ethernet profile&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;netctl&lt;/em&gt; stores the connection profile in the folder &lt;em&gt;/etc/netctl&lt;/em&gt;. This folder has a child one named &lt;em&gt;/etc/netctl/example&lt;/em&gt; which contain a set of different example profiles. We are interested here in the example profile whose name starts with ‘ethernet’. In my case I have 3 examples:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ethernet-custom : allows you to see all the available fields you can set up&lt;/li&gt;
  &lt;li&gt;ethernet-dhcp : example to connect and get the IP address from a DHCP server&lt;/li&gt;
  &lt;li&gt;ethernet-static : example to setup a profile using a static IP address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As my router is doing as well DHCP server for me, I will simply set up the profile using ethernet-dhcp as a sample. The steps we have to do are:&lt;/p&gt;

&lt;h3 id=&quot;find-the-ethernet-network-interface-name&quot;&gt;Find the ethernet network interface name&lt;/h3&gt;
&lt;p&gt;Linux has a command line &lt;em&gt;ip&lt;/em&gt; utility that allow you to query and update the network interfaces. The command line to run to list the network interfaces is&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip link
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result of the query is in my case
&lt;img src=&quot;/assets/posts/2016-02-15-ArchLinux-Setting-Network-With-Netctl/IpLinkResult.png&quot; alt=&quot;IpLinkResult&quot; /&gt;&lt;br /&gt;
  The ethernet adaptor name starts everytime with &lt;em&gt;enp&lt;/em&gt; - in my case the name is &lt;em&gt;enp3s0&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;copy-the-example-etcnetctlexampleethernet-dhcp-to-etcnetctl&quot;&gt;Copy the example &lt;em&gt;/etc/netctl/example/ethernet-dhcp&lt;/em&gt; to &lt;em&gt;/etc/netctl&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;We need to copy the example file &lt;em&gt;/etc/netctl/example/ethernet-dhcp&lt;/em&gt; to the folder &lt;em&gt;/etc/netctl&lt;/em&gt; and give it a name that is meaningful. In my case I will name it &lt;em&gt;enp3s0-ethernet-dhcp&lt;/em&gt; because it’s a good representation of the profile’s meaning.
Back to the command shell to copy the file using :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/netctl/example/ethernet-dhcp /etc/netctl/enp3s0-ethernet-dhcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;edit-the-profile&quot;&gt;Edit the Profile&lt;/h3&gt;
&lt;p&gt;You can use any text editor that you want - &lt;em&gt;vim&lt;/em&gt; is the one I’m using every time. We want to open &lt;em&gt;/etc/netctl/enp3s0-ethernet-dhcp&lt;/em&gt; to change the property &lt;em&gt;Interface&lt;/em&gt; with the one we found at step 1.
The content you should have in the file at minimum is :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/posts/2016-02-15-ArchLinux-Setting-Network-With-Netctl/enp3s0-ethernet-dhcp-Content.png&quot; alt=&quot;profile Content&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;check-the-permission&quot;&gt;Check the permission&lt;/h3&gt;
&lt;p&gt;The profile we just updated is good, however this is not protected against being seen by unauthorised users. This profile doesn’t have a lot of important information, although it will do later on for the wifi setup. We will change the password using the command line &lt;em&gt;chmod&lt;/em&gt; and set read/write only for the root users.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod 600 enp3s0-ethernet-dhcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;plug-in-the-ethernet-cable-and-start-the-profile&quot;&gt;Plug in the ethernet cable and start the profile&lt;/h3&gt;
&lt;p&gt;We can now plug in our ethernet cable and start the profile. We will use the command line netctl. The command to start the profile is&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netctl start enp3s0-ethernet-dhcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The best command to test that the profile is enabled and that you can access the network is to ping the google dhcp server with the address 8.8.8.8 :-)&lt;/p&gt;

&lt;h2 id=&quot;setting-wifi-profile&quot;&gt;Setting wifi profile&lt;/h2&gt;

&lt;p&gt;If you installed the package &lt;em&gt;dialog&lt;/em&gt; in the first post about installing &lt;em&gt;archlinix&lt;/em&gt;, this allows you to use a simple user interface that doesn’t require X windows to be installed. The command we will use is &lt;em&gt;wifi-menu&lt;/em&gt;, which is a simple script built on top of netctl.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Please always use the command *wifi-menu* with the option *-o* to be sure that the password is hashed in the profile file.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Running the command &lt;em&gt;wifi-menu&lt;/em&gt; will create the profile file in the folder &lt;em&gt;/etc/netctl&lt;/em&gt; and connect you to the network at the same time. You can even run the command again to connect to the wifi anytime you want to change the connection. The command you have to run is the following&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;wifi-menu &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will see the following displayed:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/posts/2016-02-15-ArchLinux-Setting-Network-With-Netctl/wifi-menu.png&quot; alt=&quot;wifi-menu&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Creating a wifi profile is simple with the use of &lt;em&gt;wifi-menu&lt;/em&gt;. However you can also create a wifi profile using the same type of manual steps as we used to set up the ethernet connection. The hardest part I found about doing that is that you need to know the wifi security type and you may have to put your password in clear.&lt;/p&gt;

&lt;h2 id=&quot;usage-of-netctl&quot;&gt;Usage of &lt;em&gt;netctl&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;Earlier we already use the command &lt;em&gt;netctl&lt;/em&gt; to start the ethernet connectoin. &lt;em&gt;netctl&lt;/em&gt; has a lot more option that I will list now.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;List and display active connection&lt;/li&gt;
  &lt;li&gt;Stop/Start connection&lt;/li&gt;
  &lt;li&gt;Enable/Disable auto start connection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;listing-the-profile-available&quot;&gt;Listing the profile available&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;netctl&lt;/em&gt; is using the folder &lt;em&gt;/etc/netctl&lt;/em&gt; to save the registered profile. What is good is that the tool has an option to list that directly and display as well the connections that are active with a *.&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;netctl list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output of that command will look like that.
&lt;img src=&quot;/assets/posts/2016-02-15-ArchLinux-Setting-Network-With-Netctl/netctl-list.png&quot; alt=&quot;netctl-list&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;starting-and-stoping-profile&quot;&gt;Starting and stoping profile&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;netctl&lt;/em&gt; allow to start and stop connection profile. This command require root permission and need to be run under &lt;em&gt;sudo&lt;/em&gt;.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# start the connection&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netctl start wpl1s0-myconnection

&lt;span class=&quot;c&quot;&gt;# Stop the connection&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netctl stop wlp1s0-myconnection
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;enable-and-disable-auto-connection-as-start&quot;&gt;Enable and disable auto connection as start&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;netctl&lt;/em&gt; can add a conneciton into &lt;em&gt;systemctl&lt;/em&gt; which control the linux services. This is really usefull if you are connection everytime with the same profile, like ethernet or your home wifi. We will see later on how we could automate that even more so the system can detect and automatically switch profile for you.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#Enable the profile wlp1s0-myconnection to start at boot&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;wpl1s0-myconnection

&lt;span class=&quot;c&quot;&gt;#Disable the prfile wlp1s0-myconnection to start at boot&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;netctl disable wpl1s0-myconnection
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;automating-auto-connection&quot;&gt;Automating auto connection&lt;/h2&gt;
&lt;p&gt;The information below come from the Archlinux Wiki on [netctl][https://wiki.archlinux.org/index.php/netctl#Automatic_switching_of_profiles]. The next step will require you to have a network connection active (ethernet or wifi) because we will need to install some new packages.&lt;/p&gt;

&lt;h3 id=&quot;ethernet&quot;&gt;Ethernet&lt;/h3&gt;
&lt;p&gt;So far you can only connect using the command line &lt;em&gt;netctl&lt;/em&gt;. This is great, however it would be even better if when you plug-in an ethernet cable your computer reconize it and get automatically an IP address. Luckilly they are a service that you can install that know how to read the &lt;em&gt;netctl&lt;/em&gt; config file and which will automatically handle the connection. The package is named &lt;em&gt;ifplugd&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Install ifplugd&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; ifplugd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Enable the service
Please note that you need to replace &lt;em&gt;enp3s0&lt;/em&gt; with the identifier of your network interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;netctl-ifplugd@enp3s0.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;wifi&quot;&gt;Wifi&lt;/h3&gt;
&lt;p&gt;I will provide you as well the way for the Wifi connection to automatically witch between your available profile and pick up the best one. Personally I don’t like my computer to do think for me and I don’t mind typing one command to connect, so I haven’t enabled this service. I feel as well it’s more secure that way.
The service that allow auto connection of wifi profile is named &lt;em&gt;wpa_actiond&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Install wpa_actiond&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; wpa_actiond
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Enable the service
Please note tht you need to replace teh &lt;em&gt;wlp1s0&lt;/em&gt; wuth the identifier of your wifi interface&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo systemctl enable netctl-auto@wlp1s0.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;Great, now we have some network, which will allow us to install new package and application to setup the rest of the computer. One think we will foccus on next is the user interface. This will make the computer little more firendly :-).
See you on the next post.&lt;/p&gt;
</description>
        <pubDate>Mon, 15 Feb 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/02/15/ArchLinux-Setting-Network-With-Netctl/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/02/15/ArchLinux-Setting-Network-With-Netctl/</guid>
        
        <category>ArchLinux,</category>
        
        <category>network,</category>
        
        <category>netctl</category>
        
        
        <category>ArchLinux</category>
        
      </item>
    
      <item>
        <title>ArchLinux - disabling root</title>
        <description>&lt;p&gt;If you followed the previous article of the series about setting up Arch Linux, you should now be at the point where you have a base Linux system.&lt;/p&gt;

&lt;p&gt;In this post I will focus on the creation of a user account, installing and setting up &lt;em&gt;sudo&lt;/em&gt; and disabling the root account. You can find detailed information by following this &lt;a href=&quot;https://wiki.archlinux.org/index.php/Sudo&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;creating-a-user&quot;&gt;Creating a user&lt;/h1&gt;

&lt;p&gt;Following the reboot of your ArchLinux installation you will be asked to connect. Use root and the password you set up in the previous article.&lt;/p&gt;

&lt;p&gt;We are going to create a new account and add it to the ‘wheel’ group by default. The group &lt;em&gt;wheel&lt;/em&gt; is a group that allows you to run some restricted commands from that user. As I want this account to be an advanced power user, this is the group I want to be part of.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;useradd &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; wheel &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;account name]
passd &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;account name]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;installing-and-setting-sudo&quot;&gt;Installing and setting Sudo&lt;/h2&gt;

&lt;p&gt;The next step is to install and set up &lt;em&gt;sudo&lt;/em&gt; to allow the wheel group to run commands in elevated mode. ‘sudo’ stands for ‘Superuser Do’ and will allow us to continue the installation without using the root account.&lt;/p&gt;

&lt;h3 id=&quot;installing-sudo&quot;&gt;Installing sudo&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;setting-sudo&quot;&gt;Setting sudo&lt;/h3&gt;

&lt;p&gt;We have to edit the sudo configuration file to grant the permission. Editing the sudo configuration needs to to be done using visudo. This ensures when we are saving the file that it is valid and wont lock us.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;visudo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We are at that point in our favorite text editor, VI :-). I hope you remember your basics here. The only keys you will need are&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;i : insert&lt;/li&gt;
  &lt;li&gt;esc : exit the edit mode&lt;/li&gt;
  &lt;li&gt;:wq : save and quit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of the file you will see a section that contains a lot of commented lines (starting with #) which represent some templates. We want to add there the following lines which will allow members of the wheel group to execute any command.&lt;/p&gt;

&lt;p&gt;%wheel ALL=(ALL) ALL&lt;/p&gt;

&lt;p&gt;Follow this link if you want to read more about &lt;a href=&quot;https://wiki.archlinux.org/index.php/Sudo&quot;&gt;sudo&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;disable-root&quot;&gt;Disable root&lt;/h2&gt;

&lt;p&gt;Disabling the &lt;em&gt;root&lt;/em&gt; account is not mandatory, but is strongly recommended as everyone knows the root account on Linux.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Disconnect from the current root session&lt;/li&gt;
  &lt;li&gt;Connect with your user account&lt;/li&gt;
  &lt;li&gt;Disable root
The best way to disable the root account is to lock it. For that run the following command.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;passwd &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; root
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;

&lt;p&gt;This was a simple article that allows you to secure your base installation in the most basic way. In the next article we will look at how to set up some of the basic services and start to install some basic applications.&lt;/p&gt;
</description>
        <pubDate>Mon, 08 Feb 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/02/08/ArchLinux-disabling-root/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/02/08/ArchLinux-disabling-root/</guid>
        
        
      </item>
    
      <item>
        <title>Archlinux base installation</title>
        <description>&lt;p&gt;After years on Windows and having on the side this old Asus EeePC 11010HA collecting dust in storage I decided to give it a second life following the discovery of &lt;a href=&quot;https://www.archlinux.org&quot;&gt;Arch Linux&lt;/a&gt; and &lt;a href=&quot;http://xmonad.org/&quot;&gt;Xmonad&lt;/a&gt; from a friend who is working on a startup.
I’ve tried a lot of other windows and Linux distributions on this machine in the past without success, mainly relating to the video driver which is the Intel GMA500.  This post summarizes how to set up Arch Linux on a laptop.
I will set up this machine as a Linux development machine until I feel confident that I can do a full switch of my main PC.&lt;/p&gt;

&lt;h1 id=&quot;preparing-the-usb-drive&quot;&gt;Preparing the USB drive&lt;/h1&gt;

&lt;p&gt;The first setup before installing Arch Linux is to create a USB boot drive installation. As I don’t have any Linux machine for years I needed to find a way to create this USB boot drive on windows.&lt;/p&gt;

&lt;h2 id=&quot;download-required&quot;&gt;Download required&lt;/h2&gt;

&lt;p&gt;You will need to download two things:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.pendrivelinux.com/yumi-multiboot-usb-creator/&quot;&gt;Yumi Multiboot&lt;/a&gt; : This will allow you to create the USB Boot drive simply. If you have chocolatey installed on your machine you can run the following command &lt;code class=&quot;highlighter-rouge&quot;&gt;powershell
choco install yumi&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.archlinux.org/download/&quot;&gt;Arch Linux ISO&lt;/a&gt;: This is the ISO image&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;creating-the-usb-boot-drive&quot;&gt;Creating the USB Boot drive&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Open Yumi and set the parameters as below. Don’t forget to check “&lt;em&gt;we Will Fat32 Format F: Drive!&lt;/em&gt; “&lt;br /&gt;
&lt;img src=&quot;/assets/posts/2016-02-01-ArchLinux-Base-Installation/Yumi_Setting.png&quot; alt=&quot;Yumi setting&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Click “&lt;em&gt;Create&lt;/em&gt;” and wait for the creation of boot USB key
&lt;img src=&quot;/assets/posts/2016-02-01-ArchLinux-Base-Installation/Yumi Running.png&quot; alt=&quot;Yumi Running&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;installation-of-arch-linux&quot;&gt;Installation of Arch Linux&lt;/h1&gt;

&lt;p&gt;The instruction below are mainly out from the youtube &lt;a href=&quot;https://www.youtube.com/watch?v=Wqh9AQt3nho&quot;&gt;video&lt;/a&gt; that &lt;em&gt;Goguda55 Tech Tutorial&lt;/em&gt; made. Thank you to him!
I’ve added some information during the initial installation process, like installing wifi packages. These packages are useful when you are setting up a non wired computer.&lt;/p&gt;

&lt;h2 id=&quot;instructions&quot;&gt;Instructions&lt;/h2&gt;

&lt;p&gt;You need to boot your computer using the USB key we made above.&lt;/p&gt;

&lt;h3 id=&quot;arch-linux-version-selection&quot;&gt;Arch Linux Version Selection&lt;/h3&gt;
&lt;p&gt;You can select the installation you want to do. In our case we want to install the i686 which is the 32 bits version of Arch Linux.&lt;br /&gt;
if you want to install a 64 bits version of ArchLinux you will have to select x86_64&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/posts/2016-02-01-ArchLinux-Base-Installation/01 - ArchLinux Boot Screen.png&quot; alt=&quot;Arch Install&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This will bring you to the basic command prompt. This prompt is the one of the installation OS which is hosted on the USB Key&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/posts/2016-02-01-ArchLinux-Base-Installation/02 - ArchLinux Startup prompt.png&quot; alt=&quot;Arch base prompt&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;find-the-install-drive-name&quot;&gt;Find the install drive name&lt;/h3&gt;
&lt;p&gt;Before we start installing ArchLinux we need to find the main drive that will be used to install it. Run the command.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fdisk &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will list all the disk you have on your machine. In my case the command returns this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/posts/2016-02-01-ArchLinux-Base-Installation/03 - ArchLinux fdisk result.png&quot; alt=&quot;fdisk result&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You should see something similar to that. In my case the drive on which I want to install Arch Linux is &lt;em&gt;/dev/sda&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;create-the-partition-on-your-hard-drive&quot;&gt;Create the partition on your hard drive&lt;/h3&gt;
&lt;p&gt;We create two partitions on the drive /dev/sda.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remark&lt;/strong&gt;: Creating two partitions is the minimum you have to do. However you will find in the literature that often there can be more partitions. However in our case two are enough.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Swap partition : half of the size of your memory&lt;/li&gt;
  &lt;li&gt;Data partition : We will create a single partition for all the rest. We won’t try to be clever and create different partition for different folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the command below to start the partition manager :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cfdisk /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;format-the-main-partition-and-mount-the-new-formatted-disk&quot;&gt;Format the main partition and mount the new formatted disk&lt;/h3&gt;
&lt;p&gt;We need to format the new data partition as ext4 which is the current standard Linux file system type. Following this step we will have to mount the new formatted partition in the current Archlinux installation boot OS to be able to download and install the base Archlinux packages later on.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;initialize--the-swap-partition&quot;&gt;Initialize  the Swap partition&lt;/h3&gt;
&lt;p&gt;The Swap partition is initialized using the following simple command. The first one initializes the swap then the second enables it.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkswap /dev/sda1
swapon /dev/sda1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;enable-the-network&quot;&gt;Enable the network&lt;/h3&gt;
&lt;p&gt;This can be different depending on if you are using a wired or wireless network. I will explain below for wireless (note: wired network should be enabled by default). The base install image comes with a utility that helps you find and set up your wifi connection. Run the command below to set up your wifi connection.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wifi-menu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;download-all-the-archlinux-base-packages&quot;&gt;Download all the Archlinux base packages&lt;/h3&gt;
&lt;p&gt;Now that we have the network setup completed we can download from the Internet all the base and base-devel packages of Archlinux to the /mnt mount point. We do that by running the following command.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacstrap /mnt base base-devel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;start-archlinux-partition&quot;&gt;Start ArchLinux partition&lt;/h3&gt;
&lt;p&gt;Now that we have downloaded all the packages required for the base image of Archlinux it’s time to start that new partition. Archlinux comes with a specific tool that starts the archlinux session as root. When you run the command you will see the command prompt change.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;arch-chroot /mnt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;change-the-root-password&quot;&gt;Change the root password&lt;/h3&gt;
&lt;p&gt;First things first… securing the newly installed OS. For that we need to change the current password of the root account to which we are connecting. Run the following command and enter the new root password you want.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;passwd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;enable-locale-settings&quot;&gt;Enable locale settings&lt;/h3&gt;
&lt;p&gt;The computer locale settings are defined in the file  &lt;em&gt;/etc/locale.gen&lt;/em&gt;. This file contains all the locales predefined. We just have to uncomment the one we want to enable.  You can do that using ‘vi’ or ‘nano’. In our case we wil use nano here. When we finish editing the file /8/etc/locale.gen* we will run the command &lt;em&gt;lcoale-gen&lt;/em&gt; to generate the file we need.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano /etc/locale.gen
locale-gen
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;set-the-time-zone&quot;&gt;Set the time zone&lt;/h3&gt;
&lt;p&gt;On Linux all the time zone info is defined in &lt;em&gt;/usr/share/zoneinf&lt;/em&gt;. We will have to create a link between the time zone we want and the file &lt;em&gt;/etc/localtime&lt;/em&gt;. The first command lists the time zone info. Your time zone can be located in another child folder. For example Paris is under the folder Europe. The second command creates the link between the time zone we want and the configuration file that Linux is reading this information from.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /usr/share/zoneinfo &lt;span class=&quot;nt&quot;&gt;-ali&lt;/span&gt;
ln &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /usr/share/zoneinfo/Hongkong /etc/localtime
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;give-a-name-to-the-computer&quot;&gt;Give a name to the computer&lt;/h3&gt;
&lt;p&gt;We have to set the file &lt;em&gt;/etc/hostna,e&lt;/em&gt; to contain the name of the current computer (think of a fun name!). The best way to do that is to print to the file the name you choose using output redirection, like this:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;archlinuxEeePC &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /etc/hostname
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;install-some-useful-packages-for-wireless&quot;&gt;Install some useful packages for wireless&lt;/h3&gt;
&lt;p&gt;As we are installing ArchLinux on a laptop it is useful to install some  network tool to be able to reconnect after the reboot. The package netctl allows you to manage configuration using profiles. We are also going to install a dialog to allow the command &lt;em&gt;wifi-menu&lt;/em&gt; that we used earlier to work.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; wpa_supplicant netctl dialog
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;installing-and-setting-grub-boot-loader&quot;&gt;Installing and Setting Grub boot loader&lt;/h3&gt;
&lt;p&gt;We’re almost done…  :-)&lt;br /&gt;
We now have to install and set up the bootloader. The most common used today is Grub. The bootloader allows us to choose the OS we want to boot and take all the driver initialize. We have to run several commands to acheive the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Download the Grub package from internet.&lt;/li&gt;
  &lt;li&gt;Install Grub as bootloader on the drive &lt;em&gt;/dev/sda&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Create the default configuration of Grub. This is the default one. We will do another article how to customize that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s the commands to run:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; grub-bios
grub-install /dev/sda
mkinitcpio &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; linux
grub-mkconfig &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /boot/grub/grub.cfg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;final-steps-unmount-and-reboot&quot;&gt;Final steps. unmount and reboot&lt;/h3&gt;
&lt;p&gt;Here we are, the last step… We have to run the below command to exit the current instance of ArchLinux we just set up and return to the boot OS. Following that we will create the static information about the file system and unmount the file system and finally reboot.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;exit
&lt;/span&gt;genfstab /mnt &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /mnt/etc/fstab
umount /mnt
shutdown &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;wrapping&quot;&gt;Wrapping&lt;/h1&gt;
&lt;p&gt;Congratulations! We now have a freshly installed Archlinux base installation. In the upcoming articles we will look at the following post installation steps:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;User and security&lt;/li&gt;
  &lt;li&gt;Network confuguration&lt;/li&gt;
  &lt;li&gt;basic service and toll setup&lt;/li&gt;
  &lt;li&gt;Windows Manager and windows windows&lt;/li&gt;
  &lt;li&gt;XMonad configuration&lt;/li&gt;
  &lt;li&gt;vi advance setup&lt;/li&gt;
  &lt;li&gt;Development environment setup for .Net/F#&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 01 Feb 2016 00:00:00 +0000</pubDate>
        <link>http://blog.programmableproduction.com/2016/02/01/ArchLinux-Base-Installation/</link>
        <guid isPermaLink="true">http://blog.programmableproduction.com/2016/02/01/ArchLinux-Base-Installation/</guid>
        
        <category>Archlinux,</category>
        
        <category>Installation</category>
        
        
        <category>Archlinux</category>
        
      </item>
    
  </channel>
</rss>
