How to upgrade ubuntu server to desktop in Amazon AWS? [closed] - user-interface

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have used an instance with ubuntu-server of AWS and would like to use GUI either so I did the following operations referring,
https://aws.amazon.com/premiumsupport/knowledge-center/connect-to-linux-desktop-from-windows/
How To Set Up GUI On Amazon EC2 Ubuntu server
It could be summarized as following.
a) Installed ubuntu-desktop and vnc4server
b) Changed the security settings in AWS console to open the ports 5901, 5902
c) Changed the security settings in my computer to open the ports for outbounding
However, connecting to the ubuntu it works but I could see only the screen full with a gray color.
What should I do further?

Boot up EC2 - Ubuntu 14.04 (LTS)
Once the instance is all boot up, update it:
sudo apt-get update
sudo apt-get upgrade
sudo vim /etc/ssh/sshd_config
Change PasswordAuthentication no to PasswordAuthentication yes
Restart SSH: sudo /etc/init.d/ssh restart OR sudo /etc/init.d/sshd restart
Go into root: sudo -i
Set password for ubuntu: passwd ubuntu
Once you've finished setting your password, go back to ubuntu user: su ubuntu & cd
Install Ubuntu desktop functionality:
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y ubuntu-desktop
Install XRDP and XFCE4:
sudo apt-get install xfce4 xrdp
sudo apt-get install xfce4 xfce4-goodies
Make XFCE4 the default for RDP connections:
echo xfce4-session > ~/.xsession
Copy .xsession to the /etc/skel folder so xfce4 is set as the default window manager for any new user accounts that are created.
sudo cp /home/ubuntu/.xsession /etc/skel
Allow host port to connect to xrdp.ini:
sudo vim /etc/xrdp/xrdp.ini
Change port=-1 to port=ask-1
Restart xrdp:
sudo service xrdp restart
Go back to AWS and make sure your security group includes inbound access to RDP 3389
Go into Microsoft Remote Desktop, type in your IP address with: XX.XX.XXX.XX:3389
Check this link - and this Untested but Solutions to 14.x to 15.x:
Update/upgrade with:
sudo do apt-get update
sudo apt-get dist-upgrade
sudo do-release-upgrade

Make it short and simple:
apt-get update –y
apt-get upgrade –y
apt-get install ubuntu-desktop xfce4 firefox
apt-get install xrdp
echo xfce4-session >~/.xsession
Below lines will solve your problem
THE FIX: edit /etc/xrdp/startwm.sh
make the last two lines look like this;
#. /etc/X11/Xsession
. /usr/bin/startxfce4
NOTE: Don't forget to create new users with password. Extremly necessary.
With this you can simply RDP(Remote Desktop) to the Ubuntu GUI machine.
Donot forget to open ports in Security Groups and Firewall if any implemented.

Related

Connect to CentOS desktop (GUI) installed on Google cloud

I've installed Centos7 on the Google Cloud Platform, as you know there is just ssh option to connect to the machine.
Now I need to have access to its desktop(GUI) from my laptop (it's win10).
it's appreciated if anyone can help me.
Thanks in advance
you need to ssh login into your CentOS machine either from ssh button in Gcloud, or using the cloud shell:
gcloud compute ssh test-vws
then setup a password for your account:
sudo passwd `whoami`
After that, you will need to install a client that will allow you to navigate the GUI for your server.
again, on your server command line execute:
sudo yum -y update
sudo yum -y groupinstall 'Server with GUI'
once finished, follow this guige to install and setup Teradici Cloud Access Software (Remote Desktop Agent for CentOS).
Installing Teradici Cloud Access Software
On your virtual workstation, install the Teradici repositories:
sudo yum -y install https://downloads.teradici.com/rhel/teradici-repo-latest.noarch.rpm
Install Teradici Standard Agent for Linux:
sudo yum -y update
sudo yum -y install pcoip-agent-standard
Then you will have to register the Agent and create a firewall rule to allow the connection, just follow the guide, and your desktop connection will look like this:

Script asking for confirmation despite using -y

I am trying to develop a script to setup software and some firewall rules. This is run on a fresh VPS while connected via SSH as the root user.
There are 2 points in the script where it appears to ignore '-y'
First Item:
apt update && apt upgrade -y && apt autoremove -y && apt autoclean -y
Causes this prompt to occur: Restart services during package upgrades without asking? Which I would like to just automatically select Yes.
Second Item:
ufw allow 1635/udp
ufw allow ssh
ufw enable
Causes this prompt to occur: Command may disrupt existing ssh connections. Proceed with operation? Which I would also like to just automatically select Yes.
Any help would be much appreciated. This 2 are currently stopping it from being a completely hands-off setup process.
Solved!
First Item
Discovered it was the apt upgrade causing the GUI prompt.
This was resolved by updating it to: DEBIAN_FRONTEND=noninteractive apt upgrade -y
Second Item
Resolved by updating ufw enable to: yes | ufw enable

How to create Virtualbox shared folder between Windows host and Ubuntu18.04 guest machine [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I've read docs and all questions about sharing folder from host machine to Virtualbox's guest machine and still can't get it working. In my case the host is Windows machine and guest is Ubuntu18.04 server machine.
What is advised and what I've already tried:
1) In the VM's menu I found 'devices' submenu and clicked 'Insert Guest Additions CD image' option after which the CD icon in the status bar was lit and shows that the CD is inserted and the path to iso is C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso (I checked that file really exists there).
2) In the same 'devices' VM's settings submenu I opened 'Shared Folder Settings' and added shared folder with name 'test' and path 'D:\test' which leads to the folder on my D: disk which contains test files.
3) I reboot my Ubuntu VM and look into /media directory expecting to find /media/cdrom directory or something like this with file VBoxLinuxAdditions.run in it, which should be run according to docs. But /media directory is empty so I have nothing to do with it. I looked for this file into other directories but had no success.
After that I tried to install Virtualbox-guest-additions from repository as was advised on ubuntu forum:
sudo apt-get update
sudo apt-get install virtualbox-guest-dkms
And checked that the package was installed with command:
lsmod | grep -io vboxguest
But when I rebooted and tried to mount the shared folder with:
mkdir -p /home/myusername/test
sudo mount -t vboxsf test /home/myusername/test
I've got error:
mount: /home/myusername/test: wrong fs type, bad option, bad superblock on /home/myusername/test, missing codepage or helper program or other error.
I see there is no /sbin/mount.vboxsf link present, I'm not sure if this is a problem, also I tried add my user to 'vboxsf' group with:
sudo usermod -a -G vboxsf myusername
but the group was not created too.
What am I missing, what is the way to make it work?
After a whole day of trying different solutions I finally found the missing ingredient. But I'm gonna repeat my topic content partially and put here step by step instruction for someone struggling with this task like me.
We suppose that we already have the Ubuntu 18.04 VM installed and the linux user "myusername" with sudo permissions on this machine.
So, to share folder D:\test (just as an example) on Windows host machine to Ubuntu 18.04 Virtualbox's guest machine (it's content should be available in /home/myusername/test directory) we make these steps:
1) Start Ubuntu VM from VirtualBox interface
2) Open "Shared Folder Settings" in the "devices" submenu of the started Ubuntu VM window's upper menu and set the shared folder name as "test" and the path as "/home/myusername/test" and fill the checkbox "Make Permanent"
3) Install virtualbox-guest-dkms and virtualbox-guest-utils packages to Ubuntu VM with the package manager.
sudo apt-get update
sudo apt-get install virtualbox-guest-dkms
sudo apt-get install virtualbox-guest-utils
4) Create a directory /home/myusername/test on your Ubuntu VM
mkdir /home/myusername/test
5) Restart Ubuntu VM
reboot
6) After rebooting mount shared folder in Ubuntu VM with command
mount -t vboxsf test /home/myusername/test
7) Check files in your /home/myusername/test directory, they should be the same files which are located in your Windows D:\test folder
ls /home/myusername/test
8) Additionally you can make this shared folder auto mounted after rebooting, to do so you need add the next line to your ubuntu user's /home/myusername/.profile file:
echo "sudo mount -t vboxsf test /home/myusername/test" >> /home/myusername/.profile
and give your user permission to mount without entering password with opening "sudo visudo" command (which is used to change the /etc/sudoers file) and add the next line:
myusername ALL = (ALL) NOPASSWD: /bin/mount
That's it, after these steps I've managed to share files from Windows host to Ubuntu guest machine. I'd like to mention that the shared directory itself and all files inside it belong to root but has 777 rights so there is no problem using them as any user can do whatever he wants with them.
personally the below commands helped me, it attaches a disk that you have to fill your credentials and boom...
sudo apt-get install virtualbox-guest-dkms
sudo apt-get install virtualbox-guest-utils

how to get GUI on Amazon ec2 ubuntu instance

I have an Amazon ec2 instance in which I can login through putty. I want GUI on that instance. Please anyone help me, how can I get GUI on ec2 instance.
Install VNC and connect using VNC. View the video here.
You can also use an X11 server like MobaXTerm: http://mobaxterm.mobatek.net/ ot Xming: http://sourceforge.net/projects/xming/ (assuming you work on a PC running Windows).
login ec2 instance and execute below commands
Sudo apt-get update
Sudo apt-get install lxde
sudo start lxdm
sudo apt-get install xrdp
sudo passwd ubuntu
then open RDC
username -- hostname which you provided in putty

Clamav installation steps for linux centos

I have tried to install clamav in linux centos, but not able to succeed, so anybody provide me the procedure to install clamav antivirus and test the same.
Thanks in advance
First thing to do is install the program sudo apt-get install clamav
It´s necessary install the deamon program as well sudo apt-get install clamav-daemon
Once that we have the program properly installed, will be necessary configure to make it works with our app. /etc/clamav/clamd.conf
TCPAddr 127.0.0.1
TCPSocket 3310
To configure by console the antivirus just type sudo dpkg-reconfigure clamav-freshclam
Restart the service sudo /etc/init.d/clamv-* restart
For CentOS 6
Install ClamAV via yum epel repo:
yum install clamd
Edit config file:
vim /etc/clamd.conf
ExtendedDetectionInfo yes
ExcludePath /usr/local/maldetect/
DetectPUA yes
Set to start on boot:
chkconfig clamd on
Update ClamAV prior to a scan:
freshclam
Start ClamAV:
service clamd start
Add the cron for daily automatic scans:
vim /etc/cron.daily/daily-clamscan
#!/bin/bash
SCAN_DIR="/"
LOG_FILE="/var/log/clamav/daily-clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE
Set proper cron permissions:
sudo chmod +x /etc/cron.daily/daily-clamscan
Update the logrotate file to look for all logs via wildcard
vim /etc/logrotate.d/daily-clamscan
/var/log/clamav/daily-clamscan.log {
missingok
notifempty
create 644 clam clam
}
Thats how I installed it on my machine. Here are a few good quick commands or you can use the cron to manually run it. I also installed Linux Malware Detect (LMD) with it so I can do more for my scans.
Full System Scan that only displays infected files and runs in the background with bell
Use jobs command to view status
clamscan -r --bell -i / &

Resources