Tip to automate full screen desktop of Linux System on VMware without VMware-tools

Tip to automate full screen desktop of Linux System on VMware without VMware-tools

Hi InfoSec Enthusiasts, Its been couple o years since I started my #InfoSec journey and over the past few years, I have had one recurring question from folks who are starting their journey. Like most of the people in the community, I also started with installing Kali Linux by Offensive Security on a virtual machine. I have went from Kali to Cyborg to Parrot but I always seem to come back to Kali.

The Problem

So, like many people, I also struggled with this type of screen format.

No alt text provided for this image

Even on the display settings, I was not able to find the screen resolution I wanted i.e. (1920x1080). I tried all of the resolution that was displayed but still it was not "The One".

No alt text provided for this image

I did, however, find a solution and have been applying it ever since.

The Solution

After viewing the Display section it was clear that there was no 1920x1080 setting to begin with, so the obvious answer was to add it to the Linux system. First it was setting up the new mode

$ xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

$ xrandr --addmode Virtual1 1920x1080

Then after adding the new resolution mode, we will simply execute it via the following command.

$ xrandr --output Virtual1 --mode 1920x1080

After executing the final command, we can see the screen transforms into a full screen desktop.

No alt text provided for this image

But this will only temporarily solve your problem, as you will again have to put in the above commands after your system goes through a reboot or even just a logout.

The Solution but Automated

If we want to achieve the same full desktop screen result every time we open our system then we will have to put it into a script file and then make it automatically execute it.

Lets create a script file and and the above commands into the file. You can use which ever text editor you are comfortable with, I will demonstrate it using nano. Make sure you are in your home directory a simple 'pwd' command can help you find out the present working directory you are currently in.

After that, just type in

$ nano screen.sh 

and paste the above mentioned commands.

No alt text provided for this image

Then use 'CRTL + o' to save you file, you need to confirm the file name so if it prompts 'screen.sh' then you can hit enter key. To close the nano text editor, just simply use 'CRTL + x' to exit. Now you should be able to view the file on your home directory. To view just use the ls -l screen.sh. You should be able to see your file. You should also be able to see the permission your file has.

No alt text provided for this image

If the result is the same, you will not be able to execute the bash file we just created. To make it executable, we will make use of the chmod command.

$ chmod +x screen.sh 

The above command will give execution privileges to your bash file from all Linux groups. If you want to learn about Linux groups and privileges follow this link. Then after executing the chmod command, your file should receive the execution privileges.

No alt text provided for this image

*NOTE: Linux system such as Ubuntu, Mint, & etc might not be logged in as a user with root privileges by default so you might have to execute the commands using sudo and type your password.*

$ sudo chmod +x screen.sh

To verify if your script works, just use the following command

$ bash screen.sh

and you should be able to gain the fill desktop screen view of your Linux.

Now moving towards the final step. Just by typing in 'Startup' on you search bar you should be able to see some results. You can also try keywords like 'Application startup' or 'autostart' then you should be able to find a similar setting as the following:

No alt text provided for this image

Then the next step is to click the add button and fill in the details as follows

No alt text provided for this image

On the command section, mention your path to the script we created earlier and leave the Trigger section on on login.

Now if all the steps have been completed, you can logout and log back into the system and from here onwards you should be able to see the full screen desktop until and unless the file is missing from its stated destination.

For those who want to jump into the autostart part, you can download the script file from here, Just be sure you put in the correct path.

Hope this helps you and maybe found this article useful. DM me if you have any queries.

One of the objectives of this tips is also to introduce some linux commands to beginners.

#COVID19 #WFH #Share2Learn #Linux #linuxtips #KaliLinux #OffensiveSecurity #OffSec #Made4Security


To view or add a comment, sign in

Others also viewed

Explore content categories