Ma présentation à Linux-Meetup Montréal décrivant comment héberger Windows Server 2019 en tant qu’invité virtuel sous Linux KVM, et comment configurer Samba pour respecter Active Directory pour le stockage de fichiers réseau.
There are several ways to experiment with Linux as a desktop operating system without making a full commitment to re-formatting your laptop, or giving up access to Windows. This post aims to provide ideas and a roadmap for a current Windows consumer considering a switch to desktop Linux, but unsure how or where to start.
There are many distributions of desktop Linux. I suggest you start with Ubuntu or Fedora.
Running Linux as a live desktop boot on a USB stick
The live version of Linux on a USB stick is useful to test the hardware on your laptop, and to get an idea of how a Linux distribution feels hands-on. The interface on Mint, for example, is quite different from the Gnome 3 desktop experience on Fedora and Ubuntu.
An example: the boot screen of a “live” distribution of Ubuntu. If you click “Try Ubuntu” the operating system will run using the USB stick as its storage.
The live version of Linux on a USB stick is impractical for day-to-day use.
(If your laptop’s SATA controller is configured for RAID mode, you will still be able to boot the live operating system from the Linux installer on a USB stick. However, you will not be able to read files on the Windows hard drive, or install Linux to the hard drive. See below for more details regarding SATA drive controllers, RAID mode, and AHCI mode.)
Running Linux as a virtual machine (VM) guest under VMware Workstation Player Free for Windows
VMware Workstation Player Free for Windows is proprietary software, but is available free of charge for personal, non-commercial use. This software offers good performance and a smooth experience.
On average, people upgrade their personal laptop every 5 years. If you buy a new laptop, consider backing up your old laptop, then reformatting the old laptop with Linux. The old machine will get a new lease on life: Linux will run faster than Windows on the same hardware. This approach allows you to experiment with Linux without committing yourself.
Checking the SATA drive controller mode in BIOS: RAID vs AHCI
(Warning: Windows partition will be unusable after changing SATA mode to AHCI, do your backup first!)
If you intend to format a computer with Linux, you need to go into the BIOS and change the SATA drive controller from RAID mode to AHCI mode.
Go into the BIOS of the laptop by pressing F2 during bootup, and change the SATA controller mode from RAID to AHCI.
Many howtos on creating multiple-boot between Windows and Linux are now obsolete
Many of the existing howtos describing how to create a multiple-boot between Windows and Linux are now obsolete. In the past 3 years, laptop motherboards have been shipping with the SATA hard drive controller set by default to RAID instead of AHCI. Changing the SATA controller mode from RAID to AHCI renders an existing Windows installation unusable. These howtos rely on resizing an existing Windows partition to create unallocated space for a Linux install. There is, however, little point in preserving a broken Windows installation.
Formatting a computer with Windows and Linux in dual-boot mode
It is possible to install Windows and Linux in a multiple-boot configuration. However this requires backing up the unique data (documents and other unique files) from the existing Windows installation, changing the SATA controller mode, doing a fresh baremetal Windows install on part of the drive space, and doing a fresh baremetal install of Linux on another part of the drive space.
Checking whether a system is set for UEFI or Legacy/BIOS mode
Check the laptop’s BIOS to determine whether the system is set for UEFI or Legacy/BIOS mode. If the system is in Legacy/BIOS mode, change the setting to UEFI mode. This will be needed later, when the Linux installer creates a multiple-boot menu using grub2.
Use Rufus, and specify partition type GPT and target system UEFI-CSM. Burn the USB stick.
Run the Windows installer. Destroy all existing partitions. Then, install Windows in a 200GB partition, but leave the rest of the drive space as “unallocated space.”
Use Rufus, and specify partition type GPT and target system UEFI-CSM. Burn the USB stick.
Run the Ubuntu Linux installer. Let the installer use the remaining “unallocated space” on the hard drive.
Linux will install with a multiple-boot menu
Linux will also install a multiple-boot menu that appears when you start the computer. By default, Ubuntu Linux will boot first, but you can choose Windows as the boot within 10 seconds.
Consider Running Windows as a virtual machine (VM) guest under KVM/qemu on a Linux desktop
The 2 machines in my home that I like best, are simple and not smart. Received as gifts, a new convection toaster oven that goes tick-tick-tick, and a bluetooth soda can speaker with very little intelligence.
Sony SRS-XB10 portable wireless speaker with Bluetooth
This speaker can pair with a phone, iPad, or a computer. It can play audio. It can act as a speakerphone. It is small, rechargeable, wireless, and sounds bigger than it is. It does not have AI, a personal assistant, skills, and does not tie into any home automation. It is just a speaker.
Black and Decker TO1950SBD convection toaster oven
This toaster oven is convection, which means that it has a fan that blows the air around while baking. It is good at baking croissants. It has a temperature control, and a timer. With a spring. That goes tick-tick-tick.
A friend registered a domain name, and wanted to send and receive branded email using that domain. If your project has a modest budget, you can send and receive branded domain email using a combination of a free webmail account and a pobox.com redirection account for US$20/year.
you can use pobox.com as your receiving post office, and have it forward your inbound email messages for that domain to a free webmail account. You can use the pobox.com SMTP server as an outbound SMTP gateway, with username and password authentication.
By publishing SPF and DKIM records in the DNS zone file for your domain, you can greatly increase the chances that branded email sent via the pobox.com server will be accepted by the remote party and not be mistaken for spam.
Checklist: what you need for branded email:
A domain (example.com)
a DNS control panel for the domain (I don’t let my hosting ISPs get my control of my DNS, I control it via the free DNS control panel that came from my registrar, GoDaddy.) You could probably do the same with your registrar.
A free webmail account (for example, a free @gmail.com account).
While I was searching for things that could speed up a MacOS Finder client’s session, I found a number of optimizations that helped speed Windows clients connected to a Samba file share.
with these suggestions for /etc/samba/smb.conf on the Samba server:
[global]# FORCE THE DISK SYSTEM TO ALLOCATE REAL STORAGE BLOCKS WHEN# A FILE IS CREATED OR EXTENDED TO BE A GIVEN SIZE.# THIS IS ONLY A GOOD OPTION FOR FILE SYSTEMS THAT SUPPORT# UNWRITTEN EXTENTS LIKE XFS, EXT4, BTRFS, OCS2.# IF YOU USE A FILE SYSTEM THAT DOES NOT SUPPORT UNWRITTEN# EXTENTS, SET "strict allocate = no".# NOTE: MAY WASTE DRIVE SPACE EVEN ON SUPPORTED FILE SYSTEMS# SEE: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798532strict allocate=Yes# THIS IS TO COUNTERACT SPACE WASTAGE THAT CAN BE # CAUSED BY THE PREVIOUS OPTION # SEE: https://lists.samba.org/archive/samba-technical/2014-July/101304.htmlallocation roundup size=4096# ALLOW READS OF 65535 BYTES IN ONE PACKET.# THIS TYPICALLY PROVIDES A MAJOR PERFORMANCE BENEFIT.read raw=Yes# SERVER SIGNING SLOWS THINGS DOWN WHEN ENABLED.# THIS WAS DISABLED BY DEFAULT PRIOR TO SAMBA 4.# Thanks to Joe in the comments section!server signing=No# SUPPORT RAW WRITE SMBs WHEN TRANSFERRING DATA FROM CLIENTS.write raw=Yes# WHEN "strict locking = no", THE SERVER PERFORMS FILE LOCK# CHECKS ONLY WHEN THE CLIENT EXPLICITLY ASKS FOR THEM.# WELL-BEHAVED CLIENTS ALWAYS ASK FOR LOCK CHECKS WHEN IT IS# IMPORTANT, SO IN THE VAST MAJORITY OF CASES,# "strict locking = auto" OR "strict locking = no" IS ACCEPTABLE.strict locking=No# TCP_NODELAY:# SEND AS MANY PACKETS AS NECESSARY TO KEEP DELAY LOW# IPTOS_LOWDELAY:# [Linux IPv4 Tweak] MINIMIZE DELAYS FOR INTERACTIVE TRAFFIC# SO_RCVBUF:# ENLARGE SYSTEM SOCKET RECEIVE BUFFER# SO_SNDBUF:# ENLARGE SYSTEM SOCKET SEND BUFFERsocket options=TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072SO_SNDBUF=131072# SMBWriteX CALLS GREATER THAN "min receivefile size" WILL BE# PASSED DIRECTLY TO KERNEL recvfile/splice SYSTEM CALL.# TO ENABLE POSIX LARGE WRITE SUPPORT (SMB/CIFS WRITES UP TO 16MB),# THIS OPTION MUST BE NONZERO.# THIS OPTION WILL HAVE NO EFFECT IF SET ON A SMB SIGNED CONNECTION.# MAX VALUE = 128kmin receivefile size=16384# USE THE MORE EFFICIENT sendfile() SYSTEM CALL FOR EXCLUSIVELY# OPLOCKED FILES.# NOTE: ONLY FOR CLIENTS HIGHER THAN WINDOWS 98/Meuse sendfile=Yes# READ FROM FILE ASYNCHRONOUSLY WHEN SIZE OF REQUEST IS BIGGER# THAN THIS VALUE.# NOTE: SAMBA MUST BE BUILT WITH ASYNCHRONOUS I/O SUPPORTaio read size=16384# WRITE TO FILE ASYNCHRONOUSLY WHEN SIZE OF REQUEST IS BIGGER# THAN THIS VALUE# NOTE: SAMBA MUST BE BUILT WITH ASYNCHRONOUS I/O SUPPORTaio write size=16384
The other day, I was thinking about 3 systems, 2 with modest specifications, and 1 system with great specs.
A 2009 desktop old Vista-class class core 2 duo 4GB RAM 120GB SSD
A 2018 netbook Celeron CPU (more like an Atom) 4GB RAM 64GB eMMC
A 2016 laptop core i7 with 16GB RAM and a 1TB SSD
It would not be a difficult quiz were the object to identify the good system vs the bad one. Hint: it’s the i7.
However, I have learned that some tasks run quite well on limited hardware.
The 2009 desktop was never designed to run with 4GB of RAM and a 120GB SSD from my junkpile, but they certainly have the effect of speeding up the system. This machine, running Fedora Linux, is a VPN server, a file server, a web server, a database server, and can play back 1080p video beautifully over a DVI connection.
The 2018 netbook which costs less than US$200 new, is essentially a Chromebook case with modest Wintel guts. Its CPU is called a Celeron, but given its clock speed and meagre 2 cores, it may as well be an Atom. And yet, this netbook is able to run Fedora Linux and Windows 10 Pro, quite well. It can even run Photoshop.
I have tried to run virtual machine emulation under both of these systems. Even with a stripped-down OS installer, the results were not pretty. For some applications, specs matter.
Although I have not yet spent serious time with a Raspberry Pi device, the full support in Fedora 29 has made me take a serious look at the platform. I predict results similar to those on the systems I described earlier.
Of course, if you throw good specs at a problem, like a recent laptop with a core i7, 8 cores, 16GB RAM, and a 1TB SSD, a lot of other things are possible. I am able to run multiple virtual machines under KVM, and have had a situation where a Linux guest was connected to one VPN, a Windows guest was connected to another, and the main desktop (“baremetal computer”) was on the main network connection, not even slowing down while the virtual machine guests did their work.
A recent sighting of a 13″ MSI and a sale for a Dell XPS 13 made me long for a small, but powerful computer. However, for travel, all I need is that little netbook. In theory, it would be fun to virtualize a few server environments for portable LAMP development, but I have been exploring “containers” like Docker that will allow me to isolate the systems with different PHP/MySQL versions without the overhead of a full virtual machine.
So the question is not whether you need more power. The question is how much power do you need for a specific use?
The containers thing is getting important – my goal will be to build 2 containers – one with mysql and php 5.x, and one with mysql and php 7.x