Oracle Linux, prevent Network Adapter from sleep when running in VirtualBox on macOS - linux

I have installed Oracle Linux 7 with the current version of VirtualBox, running on mac OS Sierra with a macbook. It therefore has a battery but is plugged in at all times.
For networking I use 2 adapters, one NAT for internet and one Host-Guest for ssh etc.
For some time now I was always wondering why I would get a broken ssh pipe, trial and error showed me that the VM will go to sleep (black screen), which causes the network adapter to break, telling me the name of the adapter and simply Reset adapter as soon as I wake it up again by typing into the vm itself.
I can then restart the network adapter via /etc/init.d/network restart and it will work again
Any ideas how I can change that? My Linux skills are very limited and I am not even sure what Oracle Linux is based on, most tips I find online do not work, no GUI also makes it difficult to just hop into power settings or something similar

This worked for me, on Windows host machine.
Configure your network adapter to
1) Allow the network adapter to wake the computer,
2) Allow a magic packet to wake the computer,
3) Allow IPV6
http://www.worldstart.com/dropped-internet-connection-in-sleep-mode/
Now, when I sleep my computer, and then wake it up, I get networking on both the host and guest, not just host.

Related

Ubuntu server 20.04 not detecting device over eth0

I am running a C# application on a ubuntu server 20.04 (running on a raspberry pi) which communicates with a controller. Both devices are connected via an ethernet cable and afterwards using a socket i search for its set ip 169.254.255.254 which remains always the same.
The application behaves the same as if the two devices are not connected throwing an exception "A socket operation was attempted to an unreachable network."
The connection worked on a raspberry pi os (latest version) but i can't use it because of a driver issue with a different component. I am also able to connect to the controller from a windows machine. Sadly i am very new to linux, ubuntu and networking and i can't figure out what could cause this issue.
Is there some kind of a setting that i need to set in order to be able to communicate with the controller?
If more information is needed please ask and i will provide.
Any IP within 169.254.x.x is problematic - in fact, according to this article, it indicates that the device is not connected to the network at all.

Ethernet connection is disconnecting on reboot, on linux VM(virtual box)

My ethernet connection is disconnecting on every reboot and I have to enable it everytime when start the machine. I not familiar with linux networking. Please help
Here is the image shows on reboot
I have to use "#nmtui" and activate the connection again and following figure shows Second image is the result after activating again
It has to be done everytime after the reboot.
(Network connection is in NAT mode)
In case of redhat types,You can go to configuration files of network interface /etc/sysconfig/network-scripts and you will see ifcfg-enp0s3 and there make ONBOOT=yes.
For Ubuntu /etc/sysconfig/network-scripts/ifcfg-enp0s3 and do the same as above.

Capturing packets on VMware machines

I have a windows PC installed VMware Workstation and Linux run on it. I want When windows communicate with Internet I can capture packets in Linux, how can I do that?
The vmware network is Bridge, and I set eth0 use command "ifconfig eth0 procmisc".
linux IP is 192.168.0.103, windows IP is 192.168.0.102
Run "tcpdump not host 192.168.0.103" with no result.
Thank you for you time and please help me
While I haven't used VMWare workstation before, I have used Oracle VirtualBox in a similar setup as you describe.
I suspect that the problem is that your network adaptor on the Linux VM is not actually accessing the physical network adaptor directly. You will be using one of the network mapping types described in http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006480 instead.
As such, you are not getting all the traffic that is going to your physical network adaptor. Instead you are getting the reduced set of traffic that VMWare is passing on to your guest.
The only way to get that is to do the snoop on your Windows host, using something like https://www.wireshark.org/

VirtualBox Linux does not return ping and host machine cannot access apache on that guest

I have a Windows7 as host and Debian as guest via VirtualBox. everything worked just fine until I did apt-get update on my guest machine and I think it scrambled some settings (not sure though...).
My current VB network settings are:
Adapter 1: Bridged Adapter
Adapter 2: Host-only adapter
My guest machine works fine, has internet connection and I can access it files via My Computer > Network, yet I cannot ping the guest machine nor access its apache webserver, any ideas?
Glad to hear it dude. :)
1 network adapter usually enough for 'normal' purpose. I use more than 1 network adapter when I want to simulate more complicated computer network plan, like I want to have experiment with proxy, router, dns etc. Just make sure you understand the networking mode that you want to use.
Thanks to #yogipriyo, removed the second adapter and selected only 1 bridged adapter and it works.

Scrambled Keyboard - VMware on Linux from NX Client on MBP

The problem:
I have a scrambled keyboard while using VMware Player on Linux from NX Client on a MacBook Pro. Letters are numbers, numbers are letters, delete is comma, e is delete; it's pure madness. I asked Google but it seems just as confused as me.
Note:
I am using an old-school mac keyboard with number pad plugged into my MBP and an additional monitor.
Things I've tried:
Altering my Linux keyboard settings (Layout: USA, USA Macintosh. Model: Apple, MBP, Apple Aluminum)
Altering my MBP keyboard settings (actually didn't see any settings that would affect this)
Unplugging my old-school keyboard with number pad and only using my MBP keyboard
Have the same issue, but with virt-manager (NX client runs on my Mac 10.6.8, connects to an Ubuntu 10.10 server and all is well, but if I run virt-manager and open a virtual machine, the keystrokes sent to the VM are all messed up).
I guess it has something to do with the Mac NX client and the VNC client (built into virt-manager) on the linux server. I tested the same setup in a Windowx XP virtual machine and it worked flawlessly. So it's got to be the Mac NX Client somehow.
As a workaround I've found that if I create an SSH with a port-forward from the remote linux-server (where I used to run virt-manager to access a VM running on another server) to the server with the VM and I forward a local port to the VM's vnc-server, then I can start up a VNC client (on the linux-server that I connect to via NX) and connect to the VM via the SSH tunnel and keys work just fine. So in my case the problem is somehow with the Mac NX Client + virt-manager's embedded VNC client.
I'm just guessing here, but VMware Player might use an embedded VNC server+client as well to show you the VM's screen. And both the reason for the problem and the workaround might be the same. Ie. try to use a separate VNC client to connect to the VM.
Update: I've got the solution to my problem, it's a KVM bug. The KVM machine starts the VNC server for the VM without specifying the correct keymap to use. See: http://blog.loftninjas.org/2010/11/17/virt-manager-keymaps-on-os-x/
The solution for VMware Player might be just as simple. A little googling revealed that VMware supports connections to a VM via VNC. Here's how to specify a keyboard layout for a VM's VNC server: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004815
Probably you just have to:
shut down the VM
open the VMX file in an editor
add the proper keyboard layout to the file as described on the page linked above (I guess you should specify the layout that your Linux server uses, eg. en-us)
start the VM and test with a VNC client
Of course it'd be better if you could tweak the Player's console to handle keycodes properly, but I did not find a fix for that.

Resources