gentoo at vmware, DnD and resizing aren't working - drag-and-drop

Drag and Drop isnt work, resizing too. Only copy-paste is work sometimes.
I thought that it is becouse vmblock errors, but after "emerge vmware-modules" vmblock errors gone and problem still exists.
Host OS - Windows.
al .cache # equery list -i xorg-server
* Searching for xorg-server ...
[IP-] [ ] x11-base/xorg-server-1.16.4:0/1.16.1
al log # lsmod | grep vm
vmblock 9176 0
vmci 57829 0
al log # eselect kernel list;
Available kernel symlink targets:
[1] linux-4.1.12-gentoo *
al log # ls /usr/src;
linux linux-4.1.12-gentoo
al vmblock # ls /proc/fs/vmblock
dev mountPoint
http://pastebin.com/jKSFqzrU
http://prntscr.com/9f6qzx
http://prntscr.com/9f6r4k
http://pastebin.com/ZcAa5CWG
http://pastebin.com/4AZRZPL8
http://pastebin.com/gDdn3FG5

Related

CISCO IOS-XR, Python3.7, Not able to run commands like 'ls' and 'df' on Cisco router

Cisco ios-xr router using CLI:
RP/0/RP0#show version
Thu Nov 25 07:53:59.103 UTC
Cisco IOS XR Software, Version 6.5.32.11I
Copyright (c) 2013-2020 by Cisco Systems, Inc.
RP/0/RP0#run
Thu Nov 25 07:54:05.231 UTC
[xr-vm_node0_RP0_CPU0:~]$df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3966080 1332040 2412860 36% /
76892 11848320 43% /mnt/ecu/vdd
[xr-vm_node0_RP0_CPU0:~]$
Using python:
I am able to run show commands using Connecthandler .send.command:
from netmiko import ConnectHandler
import subprocess
Network_Device = {"host": "10.111.22.333", "username": "USER123", "password": "Pass123", "device_type": "cisco_xr",}
Connect = ConnectHandler(**Network_Device)
Connect.enable()
version1 = "show version"
print(Connect.send_command(version1))
But not able to run 'df' or 'ls' commands, as not able to reach bash prompt i reach by running 'run' command on router.
I tried:
disk1files = subprocess.run("df", stdout=subprocess.PIPE)
print(disk1files.stdout.decode())
But seems its wrong. Please suggest the right library or code I can use here.
This is my first question here, so bear some silly questions or mistakes done in code
if on DF you are referring to "Don't fragment" then it is posible to send it like
Connect.send_command("ping 192.168.10.10 df-bit size 1600")
where 1600 represents MTU, and for ls commands is link command,
Connect.send_command("ls-active")
Connect.send_command("ls-active-enabled")
but if you are referring to df and ls in linux (disk free and list files..) then you can use os module for sending commands:
import os
os.system("ls -l")
or use call from subprocess module:
from subprocess import call
call(["ls", "-l"])
If you need to acccess cisco bash:
switch# configure terminal
switch(config)# feature bash-shell
switch# run?
run Execute/run program
run-script Run shell scripts
switch# run bash?
bash Linux-bash
switch# run bash
bash-4.2$ whoami
admin
bash-4.2$ pwd
/bootflash/home/admin
bash-4.2$

Can't run Yocto image with runqemu like described in documentation

I would like to run a Yocto image in QEMU but the way how it's described in the documentation doesn't work.
To verify I'm not doing anything wrong i followed the steps in the quick build guide:
install required packages
clone poky
checkout correct version
source build environment
set machine to qemux86 in local.conf
add sstate-mirrors and allow parallel build
start bitbake core-image-sato
do something else for the next few hours
when I try now to run that image in qemu like describe in the documentation:
runqemu qemux86
I just get the following output, nothing happens:
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - Continuing with the following parameters:
KERNEL: [/mnt/wwn-0x50014ee0576fe9ef- part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/bzImage--4.14.76+git0+3435617380_2c5caa7e84-r0-qemux86-20190305114605.bin]
MACHINE: [qemux86]
FSTYPE: [ext4]
ROOTFS: [/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.rootfs.ext4]
CONFFILE: [/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.qemuboot.conf]
runqemu - INFO - Setting up tap interface under sudo
runqemu - INFO - Network configuration: 192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running /mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.rootfs.ext4,if=virtio,format=raw -vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci -cpu pentium2 -m 256 -serial mon:vc -serial null -kernel /mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/bzImage--4.14.76+git0+3435617380_2c5caa7e84-r0-qemux86-20190305114605.bin -append 'root=/dev/vda rw highres=off mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1 '
When I try to run qemu without graphics I get a kernel panic:
runqemu nographic qemux86
...
[ 6.171521] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
[ 6.172937] VFS: Mounted root (ext4 filesystem) on device 253:0.
[ 6.175806] devtmpfs: error mounting -2
[ 6.237143] Freeing unused kernel memory: 852K
[ 6.238001] Write protecting the kernel text: 8752k
[ 6.238722] Write protecting the kernel read-only data: 2376k
[ 6.244382] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin.
[ 6.245455] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.76-yocto-standard #1
[ 6.245913] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/4
[ 6.246730] Call Trace:
[ 6.247788] dump_stack+0x58/0x72
[ 6.248071] ? rest_init+0x90/0xc0
[ 6.248320] panic+0x94/0x1c6
[ 6.248529] ? rest_init+0xc0/0xc0
[ 6.248807] kernel_init+0xda/0xf0
[ 6.249046] ret_from_fork+0x2e/0x38
[ 6.249834] Kernel Offset: 0xd800000 from 0xc1000000 (relocation range: 0xc0000000-0xd07dbfff)
[ 6.250595] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentat.
Is there something missing in the documentation?
I also tried different images...
core-image-sato
core-image-base
core-image-minimal
and finally I tried it with version 2.5.2 (sumo) instead of 2.6.1 (thud)... but no change...
When I googled for that issue I didn't really find anything helpful except increasing the memory, which didn't change anything, so I hope anyone here someone knows whats wrong...
Probably missing an appendage to the second parameter.
Browse to the folder in the error message, and check the directory qemux86 exists, chances are it doesn't.
I had to
runqemu qemux86-64
and not
runqemu qemux86
If you haven't changed MACHINE variable in your local.conf file in build directory, check out the file and make sure your image name was identical.

bash script calling rdiff-backup never ends

I want to run rdiff-backup and then switch of the raspberrypi it was running on.
I use the following script:
#!/bin/sh
date > /home/mik/rdiff-backup.log
echo "rsync start" >> /home/mik/rdiff-backup.log
rdiff-backup -v5 --print-statistics offlinebackup#server::/srv/backup /srv/datenserverBackup/backup >> /home/mik/rdiff-backup.log 2>&1
sync
date >> /home/mik/rdiff-backup.log
echo "rdiff-backup end" >> /home/mik/rdiff-backup.log
df -h >> /home/mik/rdiff-backup.log
sync
halt
The log file looks good (for the rdiff-backup part):
Sat 12 Aug 08:20:59 UTC 2017
rsync start
Unable to import win32security module. Windows ACLs
not supported by filesystem at /srv/backup
escape_dos_devices not required by filesystem at /srv/backup
Warning: name offlinebackup not found on system, dropping ACL entry.
Further ACL entries dropped with this name will not trigger further warnings
Using rdiff-backup version 1.2.8
Executing ssh -C offlinebackup#server rdiff-backup --server
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
Access control lists On
Extended attributes On
Windows access control lists Off
Case sensitivity On
Escape DOS devices Off
Escape trailing spaces Off
Mac OS X style resource forks Off
Mac OS X Finder information Off
-----------------------------------------------------------------
Unable to import win32security module. Windows ACLs
not supported by filesystem at /srv/datenserverBackup/backup/rdiff-backup-data/rdiff-backup.tmp.0
escape_dos_devices not required by filesystem at /srv/datenserverBackup/backup/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
Ownership changing On
Hard linking On
fsync() directories On
Directory inc permissions On
High-bit permissions On
Symlink permissions Off
Extended filenames On
Windows reserved filenames Off
Access control lists On
Extended attributes On
Windows access control lists Off
Case sensitivity On
Escape DOS devices Off
Escape trailing spaces Off
Mac OS X style resource forks Off
Mac OS X Finder information Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Starting increment operation /srv/backup to /srv/datenserverBackup/backup
Processing changed file .
Incrementing mirror file /srv/datenserverBackup/backup
Processing changed file abc
Incrementing mirror file /srv/datenserverBackup/backup/abc
Processing changed file abc/def
Incrementing mirror file /srv/datenserverBackup/backup/abc/def
Processing changed file abc/def/testfile.dxf
Incrementing mirror file /srv/datenserverBackup/backup/abc/def/testfile.dxf
--------------[ Session statistics ]--------------
StartTime 1502526061.00 (Sat Aug 12 08:21:01 2017)
EndTime 1502527913.72 (Sat Aug 12 08:51:53 2017)
ElapsedTime 1852.72 (30 minutes 52.72 seconds)
SourceFiles 151099
SourceFileSize 386321558216 (360 GB)
MirrorFiles 151097
MirrorFileSize 386321447731 (360 GB)
NewFiles 2
NewFileSize 110485 (108 KB)
DeletedFiles 0
DeletedFileSize 0 (0 bytes)
ChangedFiles 1
ChangedSourceSize 0 (0 bytes)
ChangedMirrorSize 0 (0 bytes)
IncrementFiles 4
IncrementFileSize 0 (0 bytes)
TotalDestinationSizeChange 110485 (108 KB)
Errors 0
--------------------------------------------------
The backup is working, but then the script ends right there.
rdiff-backup.log contains the full report of rdiff-backup. But neither the line "rdiff-backup end", nor the output of "df -h".
How can I make it ran to the end?
Thanks for your answers
I finally found a workaround, that solves my problem.
My sciprt which is called after booting from /etc/init.d is calling the other script which does the actual work (i.e. backup my data, and write the log file) as a background task.
/etc/init.d/CallAfterBoot.sh
#!/bin/sh
sleep 30
/home/me/DoBackup.sh & # '&' starts the script in background
/home/me/DoBackup.sh is the script I posted above which is now runing correctly.
Same script running as the same user now behaves differently. There's got to be some bug somewhere, however, it works for me now.

Cloning a Bootable SD Card from Linux Using dd command

I have a Raspberry Pi with the default, store-bought operating systems on it. I want to wipe the SD card clean so that I can put in a new operating system, but I want to preserve the original OS in a backup disc image. I planned to store it in a .bin file. The SD card has two partitions.
I used the following command to figure out which drive is the SD card.
sudo dmesg | tail
--output--
[ 2954.642182] sd 3:0:0:0: [sdb] Attached SCSI removable disk _
[ 2955.149750] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
I believe this tells me that it is under dev/sdb2, but I also tried dev/sdb, ~/dev/sdb and ~/dev/sdb2. I used the following command to create the image:
dd if="dev/sdb2" of="~/Desktop/Pi Backup/Pi.bin"
But when I try to do this it returns the error message
dd: opening `dev/sdb2': No such file or directory
I'm running Linux Mint, Cinnamon.
Any help is appreciated.
Instead of doing:
sudo dd if="/dev/mmcblk0p1" of="Pi_1.bin"
sudo dd if="/dev/mmcblk0p2" of="Pi_2.bin"
try:
sudo dd if="/dev/mmcblk0" of="Pi.bin"
p1 and p2 are the partitions in that device and you want to make an image of the entire device.
All devices are under /dev
dev is looking for dev under the current directory and ~/dev is looking for dev under your home directory.
/dev/sdb2 if the second partition, I would expect use have /dev/sdb1 (the first partition) too.
sudo dmesg | tail -30
will give you the last 30 lines, then you should be able to see the sdb1 too.
I'm on Mint 14 and I did mount and the SDcard shows as 2 partitions like below
/dev/mmcblk0p1 on /media/nig/3312-932F type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
/dev/mmcblk0p2 on /media/nig/b7b5ddff-ddb4-48dd-84d2-dd47bf00564a type ext4 (rw,nosuid,nodev,uhelper=udisks2)
so I then did
sudo dd if="/dev/mmcblk0p1" of="Pi_1.bin"
sudo dd if="/dev/mmcblk0p2" of="Pi_2.bin"
seemed to work, not sure about restoring, not tried that yet

Simple Device Driver Issue : cat: /dev/chardev: No such device or address

I am trying to learn Device Drivers and tried to compile a code, but I get the below error messages. I would appreciate if you give me pointers to resolve this issue
cat: /dev/chardev: No such device or address
Below are the logs:
#ubuntu:~/Desktop/C_code$ lsmod
Module Size Used by
chardev 12767 0
#ubuntu:~/Desktop/C_code$ ls -l /dev
crw-rw-rw- 1 root root 77, 0 2011-10-03 20:47 chardev
~/Desktop/C_code$ uname -r
2.6.38-8-generic
I am using the code from the following site "http://tldp.org/LDP/lkmpg/2.6/html/x569.html"
Try: cat ~/Desktop/C_code/dev/chardev. That file isn't necessarily in /dev yet, but you could copy it there.
the problem is basically that the major and minor number represented by the device node /dev/chardev don't represent a device. put in your source code a printk of the major and minor number just after the'ye assignment.
check if the numbers in the kernel log match 77 0 as the device node declare.
if not, delete the device node, and write the following command
sudo mknod /dev/chardev c <MAJOR> <MINOR>
of course the major and minor are the ones you printed to the kernel log.
good luck.
http://tldp.org/LDP/lkmpg/2.6/html/x569.html, here
chardev is created in current working directory.So you should cat chardev in your current directory not in /dev/. Or create chardev in /dev/ directory instead.