Monday, June 24, 2019

How to boot a Windows VM into Safe Mode in ESX

How to boot a Windows VM into Safe Mode in ESX

Information:
1)      Right Click the VM
2)      Select Edit Settings
a.       Click Options
b.      Select Boot Options
c.       Set the Power-on Boot Delay to 5000ms (5 seconds)
d.      Now the VM will display the BIOS VMWare bios screen for 5 seconds, giving you enough time to click the VM and press F8
3)      Open the console window for the VM. Start the boot process.
4)      Click the console with the mouse to gain focus.
5)      Wait until the VMWare boot screen appears. 

6)      Before the counter reaches 0:00 press the F8 key and don't let up until the Windows Advanced Options Menu appears which will allow selecting the Safe Mode or other options.

Sunday, November 20, 2016

VNC in Linux

VNC server config I am trying to configure VNC server following instructions below VNC Server configuration Setting up VNC server in RHEL or Fedora. 1. up2date vnc-server (RHEL) or yum install vnc-server (Fedora) if you don't have it installed. 2. Edit /etc/sysconfig/vncservers as root. Uncomment the line: VNCSERVERS="1:put_the_user_you_will_log_in_as_here" The server will default to the resolution of the machine, so if you are going to connect to a desktop with a high resolution monitor from a laptop you will want to uncomment and set the following line also: VNCSERVERARGS[1]="-geometry 1024x768" 3. chkconfig vncserver on 4. su to the user that you will be logging in as. 5. Run vncpasswd and set the password. 6. Now run vncserver. This will create the needed initialization files. 7. Edit /home/user/.vnc/xstartup and uncomment the two lines there to get a normal desktop when you log in. 8. Now kill the Xvnc task and delete the lock files in the .vnc directory 9. service vncserver start (there might be some other lock files you need to delete; I can't remember now - check any error messages here) 10. Unfirewall 5901 tcp to allow remote connections 11. Connect from the remote machine using servername:1 To attach to the session that is running on the monitor of the machine - the session of currently logged in local user, use krfb (on the server) and krdc (on the client) for KDE, and vino for Gnome. --------------------------------------------------------------------------- I am unable to execute step 7: Edit /home/user/.vnc/xstartup and uncomment the two lines there to get a normal desktop when you log in. If I go under /home directory - I do not see any thing their. It is blank. How will I be able to implement step7. I am totally a windows person and newbie to Linux

Mount Windows CDROM in Linux

Make sure your have samba configured and running smbmount //192.188.101.133/D /mnt/cd -o username=mpasha,workgroup=saudilighting,password=userpwd

Get Tape Serial Num in Linux

[root@vmbackup dev]# sg_inq /dev/st0 standard INQUIRY: PQual=0 Device_type=1 RMB=1 \[ANSI_version=3] version=0x03 \[AERC=0] \[TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2 SCCS=0 ACC=0 ALUA=0 3PC=0 Protect=0 BQue=0 EncServ=0 MultiP=0 MChngr=0 \[ACKREQQ=0] Addr16=1 \[RelAdr=0] WBus16=1 Sync=1 Linked=0 \[TranDis=0] CmdQue=0 Clocking=0x3 QAS=0 IUS=0 length=96 (0x60) Peripheral device type: tape Vendor identification: HP Product identification: Ultrium 2-SCSI Product revision level: F48D Product serial number: HUL3M04080

Forcefully unmount a Linux disk partition

How do I forcefully unmount a Linux disk partition? It happens many times you try to unmount a disk partition or mounted CD/DVD disk and if you try to unmount device, which is accessed by other users, then you will get error umount: /xxx: device is busy. However, Linux/FreeBSD comes with fuser command to kill forcefully mounted partition. Understanding device error busy error What happens basically, is that Linux / UNIX will not allow you to unmount a device that is busy. There are many reasons for this (such as program accessing partition or open file) , but the most important one is to prevent data loss. Try the following command to find out what processes have activities on the device/partition. If your device name is /dev/sdb1, enter the following command as root user: # lsof | grep '/dev/sda1' Output: vi 4453 vivek 3u BLK 8,1 8167 /dev/sda1Above output tells that user vivek has a vi process running that is using /dev/sda1. All you have to do is stop vi process and run umount again. As soon as that program terminates its task, the device will no longer be busy and you can unmount it with the following command: # umount /dev/sda1 Following disussion allows you to unmout device and partition forcefully using Linux commands. Linux fuser command to forcefully unmount a disk partition Suppose you have /dev/sda1 mounted on /mnt directory then you can use fuser command as follows: WARNING! These examples may result into data loss if not executed properly (see "Understanding device error busy error" for more information). Type the command to unmount /mnt forcefully: # fuser -km /mnt Where, -k : Kill processes accessing the file. -m : Name specifies a file on a mounted file system or a block device that is mounted. In above example you are using /mnt Linux umount command to unmount a disk partition You can also try umount command with –l option: # umount -l /mnt Where, -l : Also known as Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. This option works with kernel version 2.4.11+ and above only. If you would like to unmount a NFS mount point then try following command: # umount -f /mnt Where, -f: Force unmount in case of an unreachable NFS system Caution: Using these commands or option can cause data loss for open files; programs which access files after the file system has been unmounted will get an error.

How to Reset "root" Password with GRUB on Enterprise Linux

How to Reset "root" Password with GRUB on Enterprise Linux If somehow you have lost the password for the system administrator user "root" you will need to reset it. This document provides a practical method to do that if you have configured system with the GRUB boot loader during the OS installation. It procedure is to boot the system in the "single user" mode and to be able to do that you must be on the system console. Please follow the steps below: 1. Reboot the system 2. When the GRUB menu is shown with list of kernels to boot or count down for boot kernel is seen immediately do the following. 3. Use the arrow key and choose the kernel you want to boot 4. Press key a to append kernel arguments before booting 5. Next line will look something like this: grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 6. At the end of the line press space bar once, then add text single or 1: grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet single or grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 1 7. Then press enter/return, system will start to boot. The esc key will cancel your edit. 8. This will bring you to a shell prompt and now you can use the passwd command to change the password for the "root" account: sh-3.00## passwd Changing password for user root. New UNIX password: ... ... After the password is reset type # reboot and after system has been completed booting you can logon with the new root password.

How to Close and Open Ports with iptables

How to Close and Open Ports with iptables Linux dedicated servers typically rely a software firewall system called iptables. With it you can control which ports allow inbound and/or outbound access. It is very important to have iptables configured properly, both for your server’s functionality and for its security. There are many tools, both command-line based and web-based that allow you to control and configure iptables. In some cases, particularly emergency situations, you may still prefer or need to use the command line. In such situations, here is an easy guide to follow. As an example, let’s suppose you want to open the TCP port 25 for your SMTP server. 1. Login to your server via SSH 2. Become root: su 3. Enter the following command: iptables -A INPUT -p tcp --dport 25 -j ACCEPT On the other hand, if you wanted to close access to the same port, you would enter: iptables -A INPUT -p tcp --dport 25 -j DROP Once you are finished, save and restart iptables /etc/init.d/iptables save /etc/init.d/iptables restart Notes: 1. Some Linux distributions, such as Red Hat Enterprise Linux and CentOS provide basic iptables management through the “setup” program. Simply run “setup” as root and configure the firewall. 2. If your server uses a web-based control panel to configure the firewall, it is not a good idea to manually play with it except in cases of emergency where you cannot access services (such as the web). 3. Some iptables management software allows you to control it without actually having to use the iptables command.

Question 8 Explanation

Compartments are the primary building blocks you use to organize your cloud resources. You use compartments to organize and isolate your res...