Category Archives: Main

Windows 10 Hyper-V VM boot not working

Here a few notes on my first attempt to install Lubuntu (a lighter version of Ubuntu) on Windows 10, using Hyper-V Manager.

I created a 2nd generation VM, selected the Ubuntu ISO, when I first tried to boot the VM, PXE boot appeared and showing “PXE Network Boot using IPv4 ( ESC to cancel ) Performing DHCP Negotiation….“, but pressing “ESC” didn’t work.

I tried pressing F12, F1, F2, you know the usual keys to show the boot menu, without success.

Since I found this PXE boot annoying, I disabled it. Here (thanks to alx9r’s answer on serverfault) how to disable PXE boot on a VM replace the VM name and computer name:

# Set the $computer_name and $vm_name variables to your computer name and target VM name
$computer_name = "your computer name"
$vm_name = "your vm name"
# Extract the Current Boot Order
$old_boot_order = Get-VMFirmware -VMName $vm_name -ComputerName $computer_name | Select-Object -ExpandProperty BootOrder
# Strip the Network Boot Devices
$new_boot_order = $old_boot_order | Where-Object { $_.BootType -ne "Network" }
# Set the New Boot Order
Set-VMFirmware -VMName $vm_name -ComputerName $computer_name -BootOrder $new_boot_order
# Confirm the New Boot Order
Get-VMFirmware -VMName $vm_name -ComputerName $computer_name | Select-Object -ExpandProperty BootOrder

This still didn’t help, as I was getting such a result “No operating system was loaded. Press a key to retry the boot sequence…”:

Pressing a key didn’t help. I dug in the settings and finally found what I was looking for, in the “Firmware” section > Boot order:

Even after moving the DVD Drive (where my Ubuntu ISO file was mounted) at the top didn’t help, I was still getting this error: The image’s hash and certificate are not allowed (DB).

The solution: go in the “Security” section > change the secure boot option to “Microsoft UEFI Certificate Authority” (or disable it).

Finally it worked:

Move Dropbox location. Dropbox will stop syncing in November 2018

If on Linux you get the notification “Move Dropbox location. Dropbox will stop syncing in November” you may have realized already that on November 7, 2018, the Dropbox client will only support the Ext4 filesystem on Linux.

Update April 2019: I tried to use dark’s dropbox filesystem fix and it worked!

Unluckily, LUKS / ecryptfs on top of an Ext4 filesystem will not be supported either.

I think that this is really a bad decision and I’m very disappointed of Dropbox, thus I’m switching to one of the many available alternatives. I decided to try

MEGA as alternative to Dropbox

On MEGA you get 50 GB* free storage on registration, subject to (here is the catch) “achievements”.

Of these 50 GB: 15 GB are your base storage, but 35 GB will expire after 1 month 🙁

You get free space + extra bandwidth (yes, there is a bandwidth limit to avoid misusing the service I guess) also if you accomplish other achievements, but they also expire after some time. See screenshot below:


In my case, I didn’t need a lot of storage to backup my most important documents, 15 GB is actually more than what I had with Dropbox. If I need extra space I’ll consider other alternatives, but for now this was the easiest to setup. Bye bye Dropbox.

If you found this post useful, consider buying a gadget for yourself or a gift for a friend using my banggood referral link and I’ll get a little commission (you still get the same -best- price). Thank you.

msbuild: CSC : error CS1617: Invalid option ‘7.3’ for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

If you are running msbuild.exe via command line and get this error:

CSC : error CS1617: Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

e.g. from also from a build agent such as jenkins, the solution may be as easy as to upgrade Microsoft Build Tools 2015.

You can do that via choco install microsoft-build-tools or manually via the official Microsoft Build Tools 2015 or by updating your Visual Studio 2017 installation.

If you found this post useful, consider buying something fun/useful for yourself or a gift for a friend using my banggood referral link and I’ll get a little commission (you still get the same -best- price). Thank you.

Useful information for new expats in Zurich, Switzerland

This is a list of useful things to know for new people arrived in Zurich or in Switzerland.

About me: I am from Ticino, I live in Zurich since 2010, during university I was a VP in the Lugano committee of the student-run world non-profit organization AIESEC. We had trainees coming to work in Lugano and we helped them to get up to speed and to understand Lugano and Switzerland as soon as possible. So in this post I’ll try to help you figure things out as well.

Health insurance

Compare health insurance at comparis: insert your residence zip code, birthday and follow the guided app to see your various options. Include all options: family doctor, HMO, telmed. If you wonder what that means, in short:

  • family doctor: each time you are sick you have to go to this person (if you don’t, you’ll get a penalty, worst case you’ll have to pay your visit yourself), good luck if the doctor has many patients or if he is in vacation. Usually old people or people living in a village chose this option as he may know you during time and advise better.
  • HMO: it’s a center with many doctors and specialists, I’m not sure but you may need to choose the center and you’ll be bound to it.
  • telmed: when you’re sick, you call a hotline, the person answering the call will assist you and basically give you “permission” to visit a doctor (you may have already researched a specialist online, or know one from your past visits) or even suggest you one or a specialist for your case. I suggest you this option, if it’s the cheapest, even better. Else if you can save up a bit with an HMO option or family doctor you may choose that one.

Franchise: in short this is the amount of money you’ll have to pay yourself besides paying the insurance. So e.g. if you select a low franchise e.g. 300 CHF, you go to the hospital because you had an accident and the bill will be 500 CHF: you will have to pay the first 300 CHF, the rest is paid by the insurance, if during the year you still need to go to the doctor, as you already paid the initial 300 CHF, the rest is paid by the insurance (in some cases you still need to participate in the costs, but the principle is as I explained). If you select a high franchise, e.g. 2’500 CHF, because you are healthy and think that you won’t have to go to the doctor or to the hospital many times, and you have to go do the doctor 4 times a year and each time the bill is 200 CHF, you have to pay those bills for a total of 800 CHF. But consider this, if you select a low franchise, you pay a higher monthly fee, up to 100 CHF more per month, compared to the higher franchise. So in the end you save up. Check the offers and change the franchise to see how it works, do the math and you’ll see.

Keep in mind: instead of paying monthly, you can save up a bit (like 2-3% discount) if you pay the entire sum for the entire year, or 2 times a year. You’ll also save up time to enter the payment details as you’ll do the operation less times.

Household insurance etc.

Household insurance will cover you, in short, for these things:

  • the house, e.g. if accidents happen, such fire, or you get robbed
  • robberies, e.g. you get something stolen not in your house, but around
  • your baggage is stolen, you get robbed in vacation (usually good household insurance offer this, so if the one you found doesn’t, check a better one that includes this) you get a refund
  • liability insurance: if you provoke some damage it’ll cover that

Bank account

UBS seems attractive as they speak English and will provide you an account with credit cards, maestro card all for free, but only during the first year. UBS will start charging you after 1 year, so maybe you should check other non-free options that will make you save in the long term. E.g. Migros Bank is FREE if you can put a capital of at least 7’500 CHF. If you won’t have that much liquidity, the account will be attractive anyway: 3 CHF/month (36 CHF/year) including maestro card.

Payments & LSV

In Switzerland we have a so called LSV for direct debit payments. What this means is that for some entities, such e.g. rent, credit cards, insurance or other regular payments you can allow the entity to automatically claim the money for the invoice from your bank account. This is quite useful if you are that kind of person that often forget to pay invoices punctually, and even get administrative fines for that. Don’t be a victim of these stupid fines, configure your payments to be smart and make your life easier, use LSV for important stuff and electronic invoices for the rest. Ask your “entity” if they have LSV. If they do they will send you a form to fill and sign, then you should not receive any invoice from them anymore. You will be able to see the payments in your e-banking, of course.

Credit cards

Check this out, the article covers also information about the Cumulus MasterCard and Coop SuperCard VISA/MasterCard: Withdraw money abroad without any fees

If it’s your first months here and you are still in probation period or simply “not stable” enough, when you apply for a credit card, you application may be denied. In this case, avoid the hassle and directly apply for a revolutionary credit card online at Revolut: the credit card if free, can be used in any country, can be used to convert currencies at the best rates, do online shopping and even withdraw a little amount of money for free. The withdrawing limit is low (200€ / month), so I suggest to use it to pay stuff at the shops, restaurants etc. and withdraw only occasionally.

Driving license

If you plan staying in Switzerland for more than 1 year, and plan driving here (even occasionally) you need to convert your foreign driving license. An international driving license won’t be enough. Fill e.g. this kind of form (in Zurich). You’ll also need a photo and let an optician fill the eye test (Fielmann will do it fast and cheap for aroud 20 CHF).


We have many supermarkets in Switzerland. The most famous ones are Migros and Coop. Don’t confuse “Migrolino” or “Coop Pronto”, they belong to the same group, but they have different opening times (e.g. the ones located at the train station are open also during holidays and until late in the evening) and thus the products are priced differently (more expensive). A very famous one is Denner (they often to weekend discounts on beers, wines etc. it’s worth to install their app and subscribe to the newsletter to be informed on those promotions), then there are also Aldi, Lidl, Spar etc.


In every city or village, the system can be a bit different. E.g. where my brother lives he puts trash on a scale and he has to pay according to the weight. In Zurich we have the so called “Zürisäcke” small ones 17 liters, or standard ones 35 liters. You can buy them at Coop, Migros, Denner etc. usually you ask for them at the check out. At Migros they sell them where they also sell the flowers. At Coop they sell them also at the Kiosk. It depends. Ask and they will tell you. Btw you may think these Zürisäcke have a standard price: it’s not the case, I think e.g. at Aldi they are slightly cheaper, or if you order them online (e.g. Coop Online) they may be even cheaper. I don’t care but if you want to save up a bit, do your own research and maybe leave a comment here for good karma 😉


Please don’t throw away together with the trash, but collect PET, other plastic containers with the “recycling sign” on them, glass bottles or broken glass, aluminium and other metals, batteries, paper and cardboard. The advantage is not only for the environment, but also for you, if you put less trash in the Zürisäcke in the end you will save up.

PET and plastics: you can usually bring those back to any supermarket and recycle them there.

Batteries can be brought back to supermarkets too.

Aluminium, metals, glass: you can find in your neighborhood a center where to throw them away. Please note, green glass must be thrown in the green glass container, brown glass in the brown glass container, transparent one in the white glass container.

Paper and cardboard: check the Entsorgungs-Kalendar, you enter your address and it will show what is collected on which day, this is useful to print and to put e.g. on your fridge. Paper is collected separately from cardboard, so collect them separately.

Electronics: you can bring old or broken electronics to electronics shops like Fust, Interdiscount, Mediamarkt etc. and by law they have to collect them. They also collect the Coffee capsules, if you have a capsules machine.

Here you find the locations where you can bring aluminium and glass:

More information at Zürich Entsorgung & Recycling

Loyalty cards

If you don’t want your wallet to explode with those cards, just scan their code with an app, e.g. Stocard (Stocard for Android, Stocard for iOS). This is useful if you forget your card the time you’ll need it, you’ll have it in the app.

Subscribe immediately to collect “points”, at Migros and Coop you will be able to use those point to buy groceries, just like cash.

  • Migros Cumulus install the Migros app to have the history of all your receipts, to activate vouchers before paying etc.
  • Coop Supercard install the Supercard app to activate promotions etc.
  • later, if you apply to get a cumulus mastercard or a coop supercard mastercard, you can associate it to your cumulus/supercard loyalty program and earn points using the credit card in any shop, not just at migros or coop, the credit card is free

Save paper

In Switzerland we are technologically advanced for many things, but still we are years behind for other obvious things. Things are changing slowly, so please be patient 😉 the good thing is that there are some options to get rid of paper, in example:

The Coop Supercard website allows to configure your settings to stop printing paper receipts (once logged in, see menu “digitale services”), but to receive a PDF instead, this is awesome to save paper and at the same time have a backup of all your receipts and warranties in your mailbox.

In your e-banking you will find a setting to activate electronic invoices and to search for merchants to subscribe to. Typical examples are electricity providers (e.g. EWZ), insurances, telecom providers etc. activate the electronic invoice so you will save time (you will just confirm to pay an invoice with one click instead of typing all banking details, invoice reference number etc. each time) and paper.

In your mailbox, probably you figured it our already, your neighbours (if you have green minded ones) have probably put a sticker “Keine Werbung”. Do the same (you normally say hat when you fill the form when you sign the contract for your flat, but if you forgot or didn’t think it through at the beginning, you can change mind later) so you won’t get a lot of advertisements, flyers etc.. You can still check offers of your favorite shops via their app or subscribe to their newsletter. Be digital, save paper! You will still receive paper spam from people that manually put advertisements in your inbox, by law it seems that they are allowed to do that. It’s kinda stupid from the consumer perspective, but you can fight this a bit: in some cases when I get angry I send those catalogs or unwanted flyers (sometimes I see many flyers on the ground, as litter, so I collect them all) back to the recipient, without stamp. You need just to write with a big pen “REFUSÉ” (from French, “refused”) and they’ll have to pay the postage fee + a little fine because it was without stamp and it created more administrative costs to the postal service. This is a good way to punish spammers. You can do that anonymously but also for catalogs etc. that were sent to you without your consent, or you unsubscribed and still they sent it to you one year later.


If you are tempted to use Cablecom, keep in mind (not many people know this) that you can do the Plombierung, which means physically deactivate the connection. Like this you can save up some of your ancillary costs, up to 30 CH/month. If you consider that for that price you can get a cheap internet connection with a fiber provider, it’s worth it. I use iWay, if you want the best (and fastest, but it will cost you a bit more) you may consider Fiber7.

Sim card with internet data

Go with Lyca Mobile. It’s the cheapest I’ve found if you need just internet. Check also the various mobile contracts on comparis.

Android Google Play: change country

Some apps can be purchased only in Switzerland, so if you want to be able to buy those apps you may need to change country of residence also in your Google Play profile. To do so, check the [FAQ] How do I change my Google Play country? I was pointed out that the article is old, so instead of point 6: open Google Play again, Go to Menu > Account > Country and Profiles > Change your country.

You may not see this option if:

  • you have changed your country within the last year.
  • you aren’t currently in a new country. This is based on your IP address.
  • you’re part of a Google Play Family Library.

Also, it seems you can change country only once a year. So if you want just to “test” this, don’t do it. Change your country only if you really need it.

Alternatively you can create a new google account just for this purpose (Play Store) and keep your original account as is, if you don’t plan to stay in Switzerland for a long time, but want to access apps exclusively available only in the Swiss market.

Public transport tickets at reduced price

If you didn’t know about the Halbtax, check more infos about the SBB  half-fare travelcard. Long story short, with this card, you can buy any ticket for half-fare, which doesn’t mean it’s always 50% the price, but almost, e.g. train tickets will be 50%, but bus tickets in Zurich and other cities will cost you the reduced price, like for children. If you make a few trips, you’ll cover the costs already.

If you are not yet 25 years old and want to discover Switzerland for a bragain, have a look at seven25 membership, for 39 CHF/month you can travel in the entire Switzerland, but only after 19:00.

Train tickets at discounted price

Many people don’t know that they can check for a connection at least one day in advance and find discounted tickets, so called super saver tickets. You see such opportunities with a % in the SBB app for smartphone. If you click a connection you see “tickets from”. These opportunities are usually valid only from a big city to another big city. The catch is that you must take exactly that train. If you lose the train, the tuicket is no valid anymore and you must buy a regular one.

There are other opportunities, such as the 1-day travelpass or the saver day pass. Have a look at the SBB website to find more opportunities.

Free ride with Uber

If you don’t have Uber (Uber for AndroidUber for iOS) yet, use this invite code to register and get a free ride for free: paolob151ue

Rent a bike

There are places to rent a bike for free. Check Bike Hire in Zurich.

The LimeBike App works quite well in Zurich. Here my invitation link To get 3 USD in credits, use this invite code: RWHXRWA

You can even borrow a bike for free, check Züri rollt.

Rent a car

We have the usual car rental multinational companies, but we also have Sharoo. People like you and me share their car and you can book it online and go to pick it up, unlock it with your phone and use it! I did rent one time a big car to pick up some furniture and it was practical.

If you hold a SwissPass card, you can activate Mobility SwissPass. You will pay a higher tariff than if you have a full membership, but as backup solution or for occasional use (like in my case) this works perfectly.

Borrow stuff

Maybe you have some friends already, to help you out. But if you don’t, join some local facebook groups, also consider to check out Sharely. It’s a sharing community where people share stuff. You can rent anything: tools, electronics, even drones. It’s not for free, but if you break the object you rent it’s even covered by insurance and you will have to pay only the first 50 CHF of damages, the rest will be covered by the insurance. E.g. you rent an expensive drone and you crash it, you will lose only 50 CHF and the owner will get a full refund.

Online shopping

If you find something interesting, you can have a look on TopPreise to see if you find another online shop that sells it cheaper. I do it all the time and save up here and there a few francs. If you are a frequent shopper you will notice that the shops with the best prices are always the same.

You for sure know ebay. In Switzerland ebay is not used much, but there is a local ebay clone called and this is used a lot. You can find good deals here too.

If you have a credit card, I recommend you to download the TWINT app and to connect it to your credit card and bank account. Like this you can save up costs when you order stuff online: often shops charge you additional costs if you choose the credit card as payment system. But if you choose Twint it’s free and it’s super convenient. You will scan a code displayed on the screen and confirm the payment. It’s more secure and faster than using credit cards.

Foreign online shopping

If you order stuff from abroad, keep in mind import custom taxes.

I order a lot of stuff from BangGood and from AliExpress. My suggestion if you are tempted to buy a lot of stuff: split your orders so that they all are under 60 CHF in value (goods + shipping costs are considered value, so keep in mind the shipping, mostly it’s free, but sometimes you need to pay, depending on the goods you buy),

If you live near the boarder with Germany, or have a friend living near the boarder, you may use an address in Germany to avoid expensive shipping costs and import taxes (especially if ordering from Germany or EU, this can be very convenient). Check in example Swiss Paket.

Receive packages

Swiss companies are often ok if you want to deliver packages at the company address, but some companies don’t allow that. Make sure to ask before you order something online. You can also register at the Swiss Post and activate your My Post 24 account, do it now as you will receive a letter to confirm it. Then you will have an address similar to a P.O. box with a personal code and you will be able to receive packages in a location of your choice. The cool thing is that you will be able to go there any time, also during the night as it’s a fully automated place, like this you will avoid the annoying queues during rush hour of (old school) people going to the post to do pick up packages etc. you can also print a label at home and send packages at a MyPost24 location.

Send a letter

Bureocracy… You need to send a few letters with your signature, you can’t do many things online… but you can use webstamp, a service that allows you to buy a stamp online and print it including the recipient address. You can print on an envelope, on a label (a sheet contains usually many labels), or on a sheet to be put inside of an envelope having the space allocated for the address, on the right or left (you can buy those envelopes at Migros or Coop, the labels too). Your letter will look more professional and you won’t need to go to the post just to buy the stamp.

Moving to a new flat

Find a new tenant using (if you use homegate you have to pay high fees) I used and found lots of people (my ad on tutti didn’t produce many results and in facebook gorups I got no interested people at all)

Swiss Post: Redirect your address to a new one


This article is in continuous progress, if you have ideas, requests or can share some hints to be published, please add a comment.

DSC: A configuration is pending: quick solution

Sometimes a DSC script doesn’t work, fails silently and stays in the system, “pending”. Then, when I try to run a new DSC script I get this error:

A configuration is pending. If you are in Pull mode, please run Update-DscConfiguration to pull a new configuration and apply it. If you are in Push mode, please run Start-DscConfiguration command with -Force parameter to apply a new configuration or run Start-DscConfiguration command with -UseExisting parameter to finish the existing configuration.

Normally I don’t have many deployments running at the same time, so I can afford to run this powershell command:

Remove-DscConfigurationDocument -Stage Pending

This deleted all the pending DSC configurations.

How to blacklist nvidia in grub

This guide is for you, if you passed through your GPU to a VM and now you want to use it in your host and have an easy way to reboot and choose a grub entry to pass it through again.


If you have a setup similar to mine, e.g. you want to passthrough your nvidia graphic card to your VM for gaming purposes, but you want to take advantage of your powerful GPU for your daily use in your host:

  1. first of all configure your system so that the nvidia driver is working correctly;
  2. then you can create a new entry in grub, so that when you boot you can choose it for gaming.


I assume that you have your system set already correctly to run a VM with GPU passthrough e.g. as explained in this very good guide: Play games in Windows on Linux! PCI passthrough quick guide.

If this is the case, vfio is loaded before any other modules, so that it can claim your GPU (if it’s blacklisted), basically you should have these entries (this may vary a bit, if you use AMD or need other modules than I do) in your /etc/modules :

apm power_off=1

1. Configure NVIDIA

If your system is set as in the assumptions mentioned above, now you need to “de-configure” your setup, so that can use your GPU in your host. Don’t worry, later you will re-add all the options you deactivate, but in a new entry in grub (see step 2).

In my case, the nouveau and nvidia drivers were blacklisted in /etc/modprobe/blacklist.conf  so I deactivated the blacklist by commenting those lines:

#blacklist nouveau
#blacklist nvidia

I also had to comment the options I added in my /etc/modprobe.d/vfio.conf :

#options vfio-pci ids=10de:13c0,10de:0fbb,8086:a12f

To make sure that the nvidia installation would detect my graphic card, I rebooted. Maybe this was not really needed, but I preferred to be safe:

sudo reboot

Installing the nvidia driver for my GTX 980 GPU was as easy as running this command:

sudo apt install nvidia-384

Now reboot and check if your nvidia graphic card works as expected.

For testing you may want to install glmark2, a tool to benchmark OpenGL:

sudo apt install glmark2

You can install steam and play some games in linux. Why playing games in a VM if you can play them directly in your host?! Try it.

2. Create an entry in grub to boot your system with GPU passthrough

I was looking for this method for a while, I even had 2 linux distros installed: one for VMs, one for my daily use. With this option, this is not needed anymore. I can have just one linux distro, but a different entry in grub to boot it with the necessary options to use my VMs.

Important: never update /boot/grub/grub.cfg , as it gets overwritten when you run the update-grub command, instead, add custom entries, as follows:

sudo pluma /etc/grub.d/40_custom

In my case, I copied the entry from /boot/grub/grub.cfg and edited as follows, to include the vfio options and to blacklist nvidia. Make sure to change the vfio pci ids with the ones of your devices you want to passthrough:

menuentry "Bionic VMs" {
	set root='hd0,gpt1'
        linux	/vmlinuz-4.15.0-20-generic root=/dev/mapper/vg0-bionic ro acpi=force apm=power_off intel_iommu=on vfio-pci.ids=10de:13c0,10de:0fbb,8086:a12f modprobe.blacklist=nouveau,nvidia,nvidia_uvm,nvidia_drm,nvidia_modeset
	initrd	/initrd.img-4.15.0-20-generic

Save, update grub, reboot and enjoy!

sudo update-grub
sudo reboot


If you can’t see your grub menu, or it’s too fast when you boot, you may customize it a bit, here how my grub is configured for me in /etc/default/grub

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="acpi=force apm=power_off intel_iommu=on"

I kept some lines commented, as sometimes I need to play with these options. I kept my timeout very low, just one second, because I want my system to boot fast, increase it if it’s too fast for you and comment the GRUB_HIDDEN_TIMEOUT line, as I did. When I need to boot differently, I just keep pressing the up/down arrow keys at boot time, until I see the grub menu.


I hope that this guide was helpful for you, if so, consider buying a gadget at banggood using my referral link. Like this (comparing to a donation) we both benefit, you get a gadget that may be useful for you and I get something too (a little commission, but the price for you is the same).

Ubuntu guide: Dropbear SSH server to unlock LUKS encrypted PC

This guide explains how to unlock a LUKS encrypted ubuntu system via SSH. This is convenient if in example you want to turn on a server but don’t have a keyboard and screen attached to it. Or if you don’t have physical access to it. I assume that you know already how to set up an OpenSSH server and you know how to activate/deactivate public key login. Else read Ubuntu Help: OpenSSH Server and check more online resources.

This guide was tested with ubuntu 18.04 and ubuntu 17.10.

To connect from Windows, I used ssh from bash (if you install Git for Windows you get bash).

Open a terminal and install dropbear and busybox:

sudo apt install dropbear busybox

You will get a warning here as it completes: dropbear: WARNING: Invalid authorized_keys file, remote unlocking of cryptroot via SSH won’t work!, just ignore it for now.

Activate BUSYBOX and DROPBEAR in initramfs

sudo nano /etc/initramfs-tools/initramfs.conf

Change BUSYBOX=auto  to option to BUSYBOX=y  and add (below it or at the end of the file) this line:


Browse to the /etc/dropbear-initramfs/ directory, which includes all the dropbear configurations needed to be included in the initramfs:

cd /etc/dropbear-initramfs/

Note: host keys are already present, as they were automatically generated during the installation of the dropbear package, so there is no need to create new ones as other guides tell you to do. Just convert the rsa one, as follows:

sudo /usr/lib/dropbear/dropbearconvert dropbear openssh dropbear_rsa_host_key id_rsa
sudo dropbearkey -y -f dropbear_rsa_host_key |grep "^ssh-rsa " >

Add your client public key to the authorized_keys. If you are logged to your machine via SSH, and your public key is already in your authorized_keys file, you can copy the existing authorized_keys file, as follows:

cp ~/.ssh/authorized_keys .

Else you can add a public key as follows: sudo echo your public key >> authorized_keys 

Set dropbear to start:

sudo nano /etc/default/dropbear

Change NO_START=1  to NO_START=0 

In dropbear, use a different port from the one you are using in your host, so you won’t get the annoying “man in the middle attack” warning in your ssh client that will notice that the host has different keys. Different ports are considered different hosts, so you won’t get any warning at all. I’ve seen other complicated solutions to avoid the warning, but I think that using a different port is the easiest and most elegant solution.

sudo nano /etc/dropbear-initramfs/config

Uncomment the DROPBEAR_OPTIONS  line and add the option to specify the port. In this example I use port 21. Use the port you desire.


Now add the script that will be needed to actually unlock your LUKS partition:

sudo nano /etc/initramfs-tools/hooks/

Copy and paste the contents from gusennan’ sh script in the file (or copy the text from the raw file), then give it executable rights:

sudo chmod +x /etc/initramfs-tools/hooks/

Update initramfs:

sudo update-initramfs -u

Disable the dropbear service on boot, so it won’t interfere with your openssh server:

sudo systemctl disable dropbear

ImportantI had to update grub and disable the splash screen, because with splash active, after connecting to dropbear and typing unlock the screen was blocked and I could not enter the LUKS password.

sudo nano /etc/default/grub

In the GRUB_CMDLINE_LINUX_DEFAULT line, replace "quiet slash"  with "quiet" , as follows:


Save and update grub:

sudo update-grub

Reboot your server:

sudo reboot

Try to connect to your machine. You must use the root user, and specify the port you configured in the previous step:

ssh root@YOURSERVER -p 21

Once connected you will see something like this:

Warning: Permanently added '[YOURSERVER]:22,[YOURIP]:22' (ECDSA) to the list of known hosts.
To unlock root partition, and maybe others like swap, run `cryptroot-unlock`
To unlock root-partition run unlock

BusyBox v1.22.1 (Ubuntu 1:1.22.0-19ubuntu2) built-in shell (ash)
Enter 'help' for a list of built-in commands.

type unlock , insert your LUKS password, if everything worked correctly your partition will decrypt and your machine will boot. You will see this:

...a bunch of other info...
Connection to 192.168.0.xx closed.

Give it time to boot, then you can finally ssh into your linux box, as usual.

Encrypted HOME directory

If not only your partition is encrypted, but also your home directory, you won’t be able to login with your public key, as the public key is saved in ~/.ssh/authorized_keys , which is encrypted.

To solve this, follow Stephen’s Encrypted Home directories + SSH Key Authentication guide.


If you get this error when you try to connect to your server, it’s because you didn’t follow my advise to change port in dropbear:

ssh root|youruser@YOURSERVER
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home/youruser/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/youruser/.ssh/known_hosts:12
  remove with:
  ssh-keygen -f "/home/youruser/.ssh/known_hosts" -R "YOURSERVER"
ECDSA host key for YOURSERVER has changed and you have requested strict checking.
Host key verification failed.

I still prefer my solution, but if you insist on using the same port, here a few nerdy solutions:

Solution 1, works like a charm in linux, but not really on bash on windows.

Solution 2, provide some command line hack to avoid the warning:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no youruser|root@YOURHOST -p YOURPORT


This guide was inspired by:

Thanks also to Stephen (link above) for his encrypted home directories solution.

I hope that this guide was helpful for you, if so, consider buying a gadget at banggood using my referral link. Like this (comparing to a donation) we both benefit, you get a gadget that may be useful for you and I get something too (a little commission, but the price for you is the same).

Change Docker images location in Windows

One of the things I wish I knew before using Docker for Windows, is that configuring where images and containers are stored is not really straight-forward. Here how to change the default location from C:\ProgramData\Docker to whatever drive and folder you like. In my case I like to keep the same structure, but in D:, like this: D:\ProgramData\Docker

To change the location via UI, from your system tray, right click on the docker (the whale) icon:

Note, this assumes that you are using Docker from the “stable” channel. With “edge” I think you may not have the “Daemon” option as in the screenshot, then keep reading to change the file manually.

Then from the menu, select “Settings…” > “Daemon” > click on the “Advanced” switch > Add (notice that every backslash is escaped with another backslash), feel free to change the location to your desired one:

"graph": "D:\\ProgramData\\Docker"

The result should look like this:

Click “Apply”, docker will restart and you are set.

Alternatively you can edit the C:\ProgramData\Docker\config\daemon.json file and add the “graph” property with your favorite text editor, then save and restart the docker service.

To restart docker: right click on the docker icon > at the bottom click on “Restart”.

Unluckily, the old images will stay in the old location and it’s up to you to manually delete them after restarting docker. They are inside C:\ProgramData\Docker\windowsfilter

I’m not sure if you can simply move them to the new location. I didn’t bother. I tried to copy the files from windowsfilter but got some errors and saw that some links were not copied correctly, so I gave up and simply built my docker files to generate a new, clean images and containers from scratch.

Ubuntu: how to prevent grub installation

I have several linux installations in my system, and I like to control the only boot partition from my main linux distro.

Sometimes I need to update the kernel image in my secondary linux distros, but apt tries to install grub. I don’t want that. I often had to let it be installed and remove it via apt remove.

A better, permanent solution is to add this file preferences.

Thanks to: jdthood answer in stackoverflow.