regain access to centos7 after modify rc.local - virtual-machine

I have a centos 7 on a vm. I put some command lines on the rc.local to initialize always the system reboot. I think i did something wrong, because when i restart the system, it frozes and dont enter centos anymore.
The internet is not on, i have to manually connect it when the centos starts, so i can't login the machine through Putty or other ssh program in order to fix the rc.local
What should i do now?

I found out the answer in this video:
www.youtube.com/watch?v=rvPtrwidhwo
When your linux appears to load completely (but get stuck) press "esc" to see where in the list of processes it got stuck.
Restart the virtual machine, and by the time it enters the mode to choose with linux you will want to load (rescue mode or normal mode), press ctrl+e to enter on a configuration/modification screen. It will show commands in the prompt.
You have to add parameters shown on the video. Search for the work "quiet". After this word and before the word LANG, add "systemd.unit=rescue.target"
Press ctrl+x to save (it will restart the vm automatic).
You will enter the rescue mode, input the root password.
Disable or modify the rc.local on (vi /etc/rc.local) in order to regain control over linux.
Then type: shutdown -r.
Restart the vm and everything will work again.

Related

How can I emulate pressing CTRL+ALT+PAUSE in my Linux VM using AutoKey?

Question:
How can I emulate pressing CTRL+ALT+PAUSE in my Linux VM using AutoKey?
I tried a script that has
keyboard.send_keys("<ctrl>+<alt>+<pause>")
in it. But it does not work.
Background:
I'm using Windows 10 and RDP to log into a Fedora Linux. Switching 100 times a day.
The RDP connection runs in Windows all the time.
If the RDP window is not in the background but active, I can press CTRL+ALT+PAUSE to go into the VM (Fullscreen). If I am inside the VM I can press CTRL+ALT+PAUSE to go back to Windows.
So far so good. I want only one button. Preferably PAUSE. Windows part is ready already with following script
Pause::
If !WinExist("RDP Tool Name")
MsgBox No Window found
WinShow, RDP Tool Name
WinActivate, RDP Tool Name
Send ^!{CtrlBreak}
Return
Is the Linux part maybe not possible because the key combination is cached somewhere before my Linux system can even notice it? Any ideas?
I solved it without any other new script. I just had to edit the RDP settings: Keyboard -> Use Windows-Hotkeys -> On this Computer

batch file launched from ssh doesn't display on host

I'm trying to launch a graphic program on a host. The program is launched from a batch file which resides on the host.
My host is Windows 10, my client is Windows Server 2008.
I tried using ssh through PuTTy and and through CygWin, getting the same results.
After launching the program from the client, it is running properly on the host - I can see the CPU usage go up and the output is written to file. However, nothing is displayed on the host's screen.
I have one user on the host, Administrator, and that is the one that I logged into through ssh.
When I launch the batch file directly from the host, everything works fine - I do see the program display properly.
Any idea why this is happening?
Thanks!
From everything I've seen, this is indeed not possible on Windows 10, at least not without some serious hacking. Instead, we're using the Python package xmlrpc, which is great for this sort of thing.

Logging the output of VBoxHeadless

I want to be able to launch a VM in headless mode and log the outputs of its tty to the command line.
Basically I have a situation where the VM will be launched remotely (hence the command line requirement), but every once and a while, the VM's bootup sequence freezes, and right now there's no way for me to debug why the VM is not booting up properly unless I go there manually and view it in a non-headless mode.
The VM itself does not have a GUI, it just boots into TTY mode.
So is there anyway I can get some debugging output from the TTY while it's headless?
One crazy idea would be using non-headless mode and taking screenshots of the window that opens, but there must be a better way!
You can use the following command to output a PNG file of the current screen, even in headless mode:
vboxmanage controlvm [vmname] screenshotpng screen.png
I am trying to get some integration testing for bootstrapped virtualboxes up and running and ran into the exact same problem. After finding out that VRDP is a dead end, because RDP cannot send text but only bitmaps, I remembered that some cloud providers require grub to output to ttyS0.
What is ttyS0 you ask? It's the serial console of course :-)
Here's how to configure Debian to output to serial console
VirtualBox allows you to redirect the serial port into either a file or a pipe, meaning you should be able to get all the information you desire by simply reading the specified filepath.

telnet windows 7 not working

I have a Windows 7 computer, and I'm trying to work with telnet.
I installed/enabled telnet (via control panel, since telnet isn't enabled by default), restarted the terminal, restarted my computer, etc.
But telnet still doesn't work. I'm getting the error : 'telnet' is not recognized as an internal or external command...
I tried editing the PATH environment variable as well, but that hasn't worked either.
I would greatly appreciate any advice.
Thank you very much!
Looks like your telnet is not installed. Simply execute the below command in your command prompt and wait till the mouse progress icon disappears. It works on windows 7. I am not sure on other machines
pkgmgr /iu:"TelnetClient"
I was having the same issue. Fixed it by running CMD as an admin.
If your Windows 7 machine is a member of an AD, or if you have UAC enabled, or both, telnet must be run as an admin. The easiest way to do this is to create a shortcut that calls cdm, and then go to the shortcut's properties and click on the Advanced button and check the "Run as an administrator" checkbox, and you're all set. Scratched my head and rebooted numerous times before finding this out...

Windows 7 Ent login loop

I have a Windows 7 Ent - 64bit system.
I am stuck in a loop, where the login screen is presented, i enter my network credentials, the welcome spinner is shown, the screen flickers like when resized, then the system goes to logging off screen and then finally goes back to the control alt delete screen.
I cannot get out of that loop for the life of me.
I contacted corp support, he came over and logged in using his login (admin level) and was able to get a desktop up.
The support people are not allowed to access the registry to correct or even look at my users settings, and my user IS NOT AN ADMIN on this machine.
Question is - is there a way to blow away my profile on this machine, or reset my registry branch to that of a new user or something???
i have bitlocker enabled on the drive - so using the emergency boot disks are almost rendered useless...
im stuck, and i dont know where to look....
any ideas would be wonderful
thanks
the admin level user logged in, and turned his back for a moment, and i was able to go in and reset the autologon registry entry...
rebooted,and all is well.
Disconnect Your USB Devices
If you like using all sorts of USB devices such as the mouse, keyboard, speakers, Bluetooth speakers, USB dongles, USB Wi-Fi adapters etc. However, these connected devices might cause the Windows 7 stuck on the welcome screen for a long time issue. Therefore, a common solution to the problem is to disconnect all externally connected devices from your PC.
Disconnect from the Internet
Sometimes Windows 10 gets stuck on the login screen because it's trying to connect to your wireless connection. If your Windows gets stuck on the welcome screen, you should make sure that you are not connected to the internet before proceeding to log in.
Run system checks
In some case, corrupt system files on your computer will cause this problem – stuck on welcome screen Windows 10/8/7. Therefore, to fix the Windows 10 freezes on startup problem, you can use CHKDSK to run some checks on your computer to see if it is the corrupted files that cause your startup problem.Restart Windows Update service
You can try restarting Windows Update service and then rename few files if you still get stuck on welcome screen Windows 10 issue.
Here are the steps:
Step 1. Open command prompt.
Step 2. Type net stop wuauserv in the run dialogue and press Enter.
Step 3. Type cd %systemroot% command and press Enter.
Step 4. Type ren SoftwareDistribution SD.old and press Enter.
Step 5. Type net start wuauserv and press Enter.
Step 6. Type exit and press Enter to close Command Prompt and restart your PC.
Step 7. Now, reboot your PC/laptop and check if the stuck on welcome screen has gone.
Restore Windows by using System Restore
System Restore is a useful feature that allows you to restore your operating system to a previous state and fixes any boot problems such as Windows 10 freezes on startup, Windows 7 hangs on welcome screen, etc.