Homestead: Disable (or better utilize) the Ubuntu 18.04 MOTD news feature

Created on 27 Aug 2018  ยท  9Comments  ยท  Source: laravel/homestead

Upon logging into a Homestead instance, I'm greeted with the following Message of the Day (MOTD):

Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-22-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Aug 27 14:34:34 UTC 2018

  System load:  0.05              Processes:           120
  Usage of /:   9.4% of 61.80GB   Users logged in:     0
  Memory usage: 20%               IP address for eth0: 10.0.2.15
  Swap usage:   0%                IP address for eth1: 192.168.10.17

 * Read about Ubuntu updates for L1 Terminal Fault Vulnerabilities
   (L1TF).

   - https://ubu.one/L1TF

 * Check out 6 great IDEs now available on Ubuntu. There may even be
   something worthwhile there for those crazy EMACS fans ;)

   - https://bit.ly/6-cool-IDEs

0 packages can be updated.
0 updates are security updates.

The lines between "Swap usage: 0%" and "0 packages can be updated" was added in Ubuntu 18.x and pulls news from motd.ubuntu.com. However, the news presented here is rarely applicable to Homestead users, as we're typically using the VM as a client on our host machines.

With that in mind, I propose that we do one of the following:

  1. Disable the MOTD news section completely; based on this Hacker News thread, setting ENABLED=0 in /etc/default/motd-news will disable the feature entirely.
  2. Offer up a Laravel and/or Homestead alternative, perhaps hosted at motd.laravel.com, with news more relevant to Laravel developers and/or Homestead users. We could then change the "URLS" setting in /etc/default/motd-news to pull more relevant news.

Most helpful comment

Offer up a Laravel and/or Homestead alternative, perhaps hosted at motd.laravel.com, with news more relevant to Laravel developers and/or Homestead users. We could then change the "URLS" setting in /etc/default/motd-news to pull more relevant news.

I like this. I'll talk to Taylor about the subdomain.

All 9 comments

Offer up a Laravel and/or Homestead alternative, perhaps hosted at motd.laravel.com, with news more relevant to Laravel developers and/or Homestead users. We could then change the "URLS" setting in /etc/default/motd-news to pull more relevant news.

I like this. I'll talk to Taylor about the subdomain.

ta-da!

    homestead-7: Running: script: Clear Variables
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Cron
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Nginx
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating MySQL Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Postgres Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Update Composer
    homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
    homestead-7: You are already using composer version 1.7.2 (stable channel).
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/7s/nblvjylx1l1ch16cg6cgsh7r0000gp/T/vagrant-shell20180904-28528-1by1p7g.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/7s/nblvjylx1l1ch16cg6cgsh7r0000gp/T/vagrant-shell20180904-28528-d9gtjj.sh
vagrant destroy -f && vagrant up: 01:44

โ”Œโ”€([email protected])(~/PhpstormProjects/homestead)(master S:5)โ”€โ”€โ”€(en0:192.168.1.36/24 vnic0:10.211.55.2/24 vnic1:10.37.129.2/24 vboxnet0:192.168.10.1/24)โ”€โ”
โ””โ”€(15:55:12)โ”€ vagrant ssh                                                                                                                                            โ”€(09/04/18)โ”€โ”˜
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-32-generic x86_64)

 _                               _                 _
| |                             | |               | |
| |__   ___  _ __ ___   ___  ___| |_ ___  __ _  __| |
| '_ \ / _ \| '_ ` _ \ / _ \/ __| __/ _ \/ _` |/ _` |
| | | | (_) | | | | | |  __/\__ \ ||  __/ (_| | (_| |
|_| |_|\___/|_| |_| |_|\___||___/\__\___|\__,_|\__,_|


0 packages can be updated.
0 updates are security updates.


vagrant@homestead:~$

This will be available in the next base box release sometime late September or early October 2018.

If you would like this feature now, you can the following code to your after.sh:

sudo sed -i "s/motd.ubuntu.com/homestead.joeferguson.me/g" /etc/default/motd-news
sudo rm -rf /etc/update-motd.d/10-help-text
sudo rm -rf /etc/update-motd.d/50-landscape-sysinfo
sudo service motd-news restart

Ooh, nice! I love the fact that you'll be able to push news when necessary via https://homestead.joeferguson.me/ ๐Ÿ‘

Thank you!

hah, nice work @svpernova09

Can someone point me to instructions to remove MOTD functionality?

If you want to the news feed, you'll need to change ENABLED=1 to ENABLED=0 in /etc/default/motd-news.

If you want to do this automatically upon provision, add the following to your user-customizations.sh file:

sudo sed -i 's/ENABLED=1/ENABLED=0/g' /etc/default/motd-news

Meanwhile, if you want everything at login to go away, you could add a .hushlogin file to your vagrant user's home directory (also via user-customizations.sh):

touch .hushlogin
Was this page helpful?
0 / 5 - 0 ratings