VirtualBox 6.0 Beta 2

It’s great to see that Oracle VirtualBox is still being actively developed, not just maintained.

I have downloaded the latest beta of the upcoming VirtualBox 6.0 release, and it feels like a nice refresh of interface and functionality.

VirtualBox 6.0 Screenshots

See Also




How To: ls colorized output in MacOS

I’m pretty used to how ls command shows pretty colorized output on most modern Linux distros, but somehow its default behaviour in MacOS is still plain white – no different colours.

I decided to look for command line option to change that, and sure enough – ls command in MacOS has -G option for colorizing output.

So, instead of running this:

$ ls /etc

you’ll run this:

$ ls -G /etc

Check out the different it makes below!

Plain ls /etc in MacOS

2018-11-10_17-26-52.png

Colorized ls -G /etc in MacOS

2018-11-10_17-27-33.png

Make colorized alias for ls command

If you like this enough, I suggestt you make an alias for ls -G:

$ alias ls='ls -G'

what this does is you can run ls, but your bash shell will be recognizing it as alias name and running ls -G instead. Any additional command line options will work, of course:

2018-11-10_17-33-46.png

Add ls alias to .bash_profile

To make this permanent, add ls alias to your .bash_profile:

$ echo "alias ls='ls -G'" >> $HOME/.bash_profile

What this will do is any new Terminal windows you open on your Mac will have the ls command alias preconfigured, so you’ll always have the output colorized.

See Also




VMware Tools or Open VM Tools?

This post talks about VMware Tools and Open VM Tools – packages that help you improve performance and integration of your Unix-like virtual machines in VMware environments.

What are VMware Tools?

VMware Tools are a set of virtual machine enhancements providing tighter integration, smoother operation and much better performance for VMs running in VMware environment. VMware Tools are available for all the platforms supported by VMware, so there’s a separate installer for Windows, Linux and Solaris.

Usually you have to install VMware Tools using virtual CD drive mapped into each virtual machine – you find and run the installer, it installs and configures tools, you reboot and enjoy VMware Tools benefits.

Benefits of Using VMware Tools

  • tools are updated in line with vSphere upgrades (so when your virtualization hosts are upgraded, you get fully optimised tools available)
  • VMware Tools version is usually the same (if you upgrade in line with vSphere upgradesS)
  • VMware Tools version is reported in the vSphere Client and using vSphere CLI

What are Open VM Tools?

Open VM Tools ‘s actually an open-source version of VMware Tools, made specifically for Linux operating systems. As a result, open-vm-tools are bundled with most modern Linux distros or available from the standard repositories.

Open VM Tools are distributed with the following packages:

  • open-vm-tools
  • open-vm-tools-desktop
  • open-vm-tools-devel
  • open-vm-tools-debuginfo

Benefits of Using Open VM Tools

  • most reliable integrartion with the vendor OS (RedHat, for example)
  • no dependencies between vSphere version and Open VM Tools version
  • no need to wait for vSphere upgrade to install Open VM Tools updates
  • no need to have vSphere access for mounting virtual CD with VMware Tools

VMware Tools or Open VM Tools?

Speaking as a Linux sysadmin and not a vSphere administrator, I would prefer open-vm-tools: installing and troubleshooting them is fully done inside Linux VM, which means you can automate Open VM Tools deployment using native tools.

The same can be done for VMware Tools as well, but would require someone with vSphere access to assist.

See Also




Raspberry Pi OS

While you probably know that Raspbian is the official OS for Raspberry Pi systems, it’s not the only operating system you can use.

In fact, most of Raspberry Pi beginners start with NOOBSNew Out Of Box Software, which is an installer you can download or buy on an SD/microSD card from most of Raspberry Pi vendors.

In addition to this, there’s now a Raspberry Pi Desktop – special distribution that allows you to try Raspbian OS inside a virtual machine or using live USB environment.

See Also




mkdir cannot create directory

2018-11-05_19-00-09.png

New Linux users often get puzzled by the “mkdir: cannot create directory” errors when taking first steps and trying to learn basics of working with files and directories. In this short post I’ll show the two most common types of this mkdir error and also explain how to fix things so that you no longer get these errors.

mkdir: cannot create directory – File exists

This should be self explanatory after a few weeks of using commands like mkdir, but the first time you see this it can be confusing.

File exists? How can it be when you’re just trying to create a directory? And why does it say “File exists” when you’re trying to create a directory, not a file?

This error suggests that the directory name you’re using (/tmp/try in my example shown on the screenshot) is already taken – there is a file or a directory with the same name, so another one can’t be created. You can use the wonderful ls command to check what’s going on:

greys@vps1:~$ ls -ald /tmp/try
drwxr-xr-x 2 greys root 4096 Nov 5 18:55 /tmp/try

Sure enough, we have a directory called /tmp/try already!

The reason it says “File exists” is because pretty much everything in Unix is a file. Even a directory!

Possible solutions to mkdir: cannot create directory – file exists scenario

Rename (move) existing directory

Use the mv command to move /tmp/try into some new location (or giving it new name). Here’s how to rename /tmp/try into /tmp/oldtry:

greys@vps1:~$ mv /tmp/try /tmp/oldtry

Let’s rerun the mkdir command now:

greys@vps1:~$ mkdir /tmp/try

…and since there are no errors this time, we probably have just created the /tmp/try directory, as desired. Let’s check both /tmp/try and the /tmp/oldtry with ls:

greys@vps1:~$ ls -ald /tmp/try /tmp/oldtry
drwxr-xr-x 2 greys root 4096 Nov 5 18:55 /tmp/oldtry
drwxrwxr-x 2 greys greys 4096 Nov 5 19:08 /tmp/try

Remove existing file

Another option you always have is to simply remove the file that’s blocking your mkdir command.

First, let’s create an empty file called /tmp/newtry and confirm it’s a file and not a directory usng ls command:

greys@vps1:~$ touch /tmp/newtry
greys@vps1:~$ ls -lad /tmp/newtry
-rw-rw-r-- 1 greys greys 0 Nov 5 20:50 /tmp/newtry

Now, if we try mkdir with the same name, it will fail:

greys@vps1:~$ mkdir /tmp/newtry
mkdir: cannot create directory ‘/tmp/newtry’: File exists

So, to fix the issue, we remove the file and try mkdir again:

greys@vps1:~$ rm /tmp/newtry
greys@vps1:~$ mkdir /tmp/newtry

This time there were no errors, and ls command can show you that indeed you have a directory called /tmp/newtry now:

greys@vps1:~$ ls -lad /tmp/newtry
drwxrwxr-x 2 greys greys 4096 Nov 5 20:50 /tmp/newtry

mkdir: cannot create directory – Permission denied

This is another very common error when creating directories using mkdir command.

The reason for this error is that the user you’re running the mkdir as, doesn’t have permissions to create new directory in the location you specified.

You should use ls command on the higher level directory to confirm permissions.

Let’s proceed with an example:

greys@vps1:/tmp$ mkdir try2018
greys@vps1:/tmp$ mkdir try2018/anotherone
greys@vps1:/tmp$ ls -ald try2018
drwxrwxr-x 3 greys greys 4096 Nov 5 21:04 try2018

All of these commands succeeded because I first created new directory called try2018, then another subdirectory inside of it. ls command confirmed that I have 775 permissions on the try2018 directory, meaning I have read, write and execture permissions.

Now, let’s remove the write permissions for everyone for directory try2018:

greys@vps1:/tmp$ chmod a-w try2018
greys@vps1:/tmp$ ls -ald try2018
dr-xr-xr-x 3 greys greys 4096 Nov 5 21:04 try2018

If I try creating a subdirectory now, I will get the mkdir: cannot create directory – permissions denied error:

greys@vps1:/tmp$ mkdir try2018/yetanotherone
mkdir: cannot create directory ‘try2018/yetanotherone’: Permission denied

To fix the issue, let’s add write permissions again:

greys@vps1:/tmp$ chmod a+w try2018
greys@vps1:/tmp$ mkdir try2018/yetanotherone

As you can see, try2018/yetanotherone directory was successfully created:

greys@vps1:/tmp$ ls -ald try2018/yetanotherone
drwxrwxr-x 2 greys greys 4096 Nov 5 21:05 try2018/yetanotherone

That’s it for today! Hope you liked this tutorial, be sure to explore more basic Unix tutorials on my blog.

See Also




Unix Tutorial Digest – November 3rd, 2018

Monthly digest of Unix/Linux topics

This monthly issue arrives a week later, but brings more news as the result: lots of OS releases in October!

Please get in touch if you want to suggest a useful link for the next digest.

Unix and Linux News

Software News

  • Won’t mention software news this months as there are so many OS releases that they steal the show

Interesting and Useful

Unix Tutorial articles