How to install linux on odroid-U3(or other odroid version)? - archlinux

I have an odroid-U3, and I don't know how to install a linux on it, can anyone tell me how to do it? and I have another question, can odroid-U3 powered by USB port?

Grab the appropriate linux distro from:
http://os.archlinuxarm.org/os/
or follow the steps below which will use the U2 image which is the same for U3:
SD Card Creation
Replace sdX in the following instructions with the device name for the SD card as it appears on your computer.
Zero the beginning of the SD card:
dd if=/dev/zero of=/dev/sdX bs=1M count=8
Start fdisk to partition the SD card:
fdisk /dev/sdX
At the fdisk prompt, create the new partitions:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Type n, then p for primary, 1 for the first partition on the drive, and enter twice to accept the default starting and ending sectors.
Write the partition table and exit by typing w.
Create and mount the ext4 filesystem:
mkfs.ext4 /dev/sdX1
mkdir root
mount /dev/sdX1 root
Download and extract the root filesystem (as root, not via sudo):
wget http://archlinuxarm.org/os/ArchLinuxARM-odroid-u2-latest.tar.gz
bsdtar -xpf ArchLinuxARM-odroid-u2-latest.tar.gz -C root
Flash the bootloader files:
cd root/boot
./sd_fusing.sh /dev/sdX
cd ../..
Unmount the partition:
umount root
Insert the SD card into the board, connect ethernet, and apply 5V power.
Use the serial console (with a null-modem adapter if needed) or SSH to the IP address given to the board by your router.
Login as the default user alarm with the password alarm.
The default root password is root.
eMMC Module Creation
Attach the eMMC module to the micro SD adapter, and plug that into your computer.
Follow the above steps to install Arch Linux ARM, and boot the board with the eMMC still attached to micro SD adapter, plugged into the SD slot in the board.
Re-flash the bootloader to the protected boot area of the eMMC module:
cd /boot
./sd_fusing.sh /dev/mmcblk0
Power off the board:
poweroff
Remove the micro SD adapter, detach the eMMC module, and connect the eMMC module to its connector on the board.
Re-apply power the board.
Use the serial console (with a null-modem adapter if needed) or SSH to the IP address given to the board by your router.
Login as the default user alarm with the password alarm.
The default root password is root.

You can follow the official guide at archlinuxarm.org/platforms/armv7/samsung/odroid-u3
Note: If you stuck at step 7 when performed
cd root/boot
./sd_fusing.sh /dev/sdX
cd ../..
you can open the file sd_fusing.sh, change the line
#!/usr/bin/bash
into
#!/bin/bash

Related

Raspberry Pi is not able to subscribe to ros topic published from base PC but vice-verse is working?

I am using the ubiquityrobotics Raspberry Pi image for the RPi 3B+, which is Ubuntu Xenial and ROS Kinetic. My base computer is running Ubuntu 18.04 and has ROS Melodic installed.
I created subo_base workspace in the base PC and subo_rpi workspace in the RPi (assessing the RPi via ssh).
Then I created a package in both the base PC and RPi and added the Publisher and Subscriber (http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29) files in each of the packages.
When I run the publisher from the RPi, the base PC is able to subscribe but when I publish from the base PC, the RPi does not show any output and remains stuck (even though the Topic is visible on RPi using rostopic list).
Base PC is able to subscribe to RPi
RPi unable to subscribe to topic from PC
Some of the code is used in base PC
aakash#aakash:~$ mkdir -p ~/subo_base/src
aakash#aakash:~$ cd ~/subo_base/
aakash#aakash:~/subo_base$ catkin_make
aakash#aakash:~/subo_base$ source devel/setup.bash
aakash#aakash:~/subo_base$ echo $ROS_PACKAGE_PATH
aakash#aakash:~/subo_base$ cd ~/subo_base/src/
aakash#aakash:~/subo_base/src$ catkin_create_pkg motion_plan std_msgs rospy roscpp
To connect to RPi
aakash#aakash:~/subo_base/src/motion_plan/scripts$ export ROS_MASTER_URI=http://ubiquityrobot.local:11311
aakash#aakash:~/subo_base/src/motion_plan/scripts$ export ROS_IP='hostname -I'
Further, I am able to transfer files from and to the base PC via ssh scp so I guess netwkr might not be the issue?
The issue is most likely the hostname resolution and/or ROS network variable configuration.
I dislike using the hostname in the variables, so I will give the examples using just IPs.
Also the 'hostname -I' is definitely not suitable for setting your ROS_IP variable in all cases. So that might also be one source of your problem.
From hostname man page
-I, --all-ip-addresses>
Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loop‐back interface and IPv6 link-local addresses are omitted. Contrary to option -i, this option does not depend on name resolution. Do not make any assumptions about the order of
the output.
You will want to use whatever specific ip address you need, so just use that or find a better way to determine which ip to set. echo $ROS_IP or printenv | grep ROS will tell you what your variables are currently set to so you can verify it is set correctly.
For minimal proof that things are working you could try the following:
Lets say your RPi ip is 192.168.0.2 and PC ip is 192.168.0.3
You will need to decide which machine will be the master, for this example I will assume the PC will be the master.
In a terminal on the PC run the following commands:
roscore
in a different terminal run (this is used instead of the subscriber/publisher node to test if things work)
rostopic pub /test/topic std_msgs/String 'Hello World from PC' -r 1
Now on the SSH terminal on the RPi run:
export ROS_MASTER_URI=http://192.168.0.3:11311 && export ROS_IP=192.168.0.2
now you should be able to echo the topic published on the PC from the SSH window.
rostopic echo /test/topic
ctrl+c out of the echo and you can try publishing some message on the RPi like:
rostopic pub /test2/topic std_msgs/String 'Hello World from RPi' -r 1
Now open a new terminal on the PC and try to echo the topic from RPi, any terminal sourced with the ROS installspace, usually source /opt/ros/kinetic/setup.bash, should work:
rostopic echo /test2/topic
ROS wiki page on running ROS on multiple machines
ROS answer regarding setting up multiple machines
ROS1
Machine1 [MASTER]:
Will run roscore, but don't run it yet till configurations are done.
Has an IP of 192.168.1.10.
1- Run the following in the terminal:
1.1- export ROS_MASTER_URI=http://192.168.1.10:11311.
1.2- export ROS_IP=192.168.1.10.
2- Now, run roscore.
Machine2 [SLAVE]
Will NOT run roscore.
Has and IP 192.168.1.15.
1- Run the following in the terminal:
1.1- export ROS_MASTER_URI=http://192.168.1.10:11311.
1.2- export ROS_IP=192.168.1.15.
2- Now, you are connected to the Master.
ROS2
ROS2 will populate the information on the LAN out of the box without any configuration.

How to install Guest addition in Mac OS as guest and Windows machine as host

I am trying to copy contents from my host machine to a guest machine, but for copying I need to install the Guest additions disk.
Or there is there another way to access host machine content on the guest machine or vice-versa?
Guest Additions are available for MacOS starting with VirtualBox 6.0.
Installing:
Boot & login into your guest macOS.
In VirtualBox UI, use menu Devices | Insert Guest Additions CD image...
CD will appear on your macOS desktop, open it.
Run VBoxDarwinAdditions.pkg.
Go through installer, it's mostly about clicking Next.
At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
If you forgot/misclicked in step 6, go to macOS System Preferences | Security & Privacy | General. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
Troubleshooting
macOS 10.15 introduced new code signing requirements; Guest additions installation will fail. However, if you reboot and apply step 7 from list above, shared clipboard will still work.
VirtualBox < 6.0.12 has a bug where Guest Additions service doesn't start. Use newer VirtualBox.
In the guest Mac, open the Terminal and go for a reboot on the Recovery partition
sudo nvram "recovery-boot-mode=unused"
sudo reboot
Now you're in Recovery mode, enter the Terminal and do:
csrutil disable
spctl kext-consent add VB5E2TV963
nvram -d recovery-boot-mode
reboot
Back in "normal" mode, open the Terminal, and do:
sudo mount -uw /
sudo chown :admin /System/Library/Extensions/
sudo chmod 775 /System/Library/Extensions/
Run the Guest Additions installer and go through the end
(in principle, it goes through successfully)
Now in the terminal, do:
sudo chown :wheel /System/Library/Extensions/
sudo chmod 755 /System/Library/Extensions/
sudo nvram "recovery-boot-mode=unused"
sudo reboot
Again in Recovery mode, go into the Terminal and do:
csrutil enable
nvram -d recovery-boot-mode
reboot
You should be set.
Guest additions are not available for Mac OS X. You can get features like clipboard sync and shared folders by using VNC and SMB. Here's my answer on a similar question.
You can use SSH and SFTP as suggested here.
In the Guest OS (Mac OS X), open System Preferences > Sharing, then activate Remote Login; note the ip address specified in the Remote Login instructions, e.g. ssh user#10.0.2.15
In VirtualBox, open Devices > Network > Network Settings > Advanced > Port Forwarding and specify Host IP = 127.0.0.1, Host Port 2222, Guest IP 10.0.2.15, Guest Port 22
On the Host OS, run the following command sftp -P 2222 user#127.0.0.1; if you prefer a graphical interface, you can use FileZilla
Replace user and 10.0.2.15 with the appropriate values relevant to your configuration.
I've the same problem, and by the "trial and error" method I have the steps to install the guest additions on a MacOS guest:
insert the guest additions cd
open the cd on file manager
double click on VBoxDarwinAdditions.pkg
the installer opens, then click contine
next screen to set location of installed files, only press install
your password can be asked a couple of time while installing, write
it and continue
this is the tricky part, on my installation, macos show an message
about the driver created by oracle won't be installed because a
security issue, it has the option to enable it, so click on the
button to open security screen and click on the allow button next to
the oracle software listed at bottom of the security settings
window, it will ask your password again. Meanwhile the pkg installer
continued as if it has permissions and will say "install finished",
but I don't believe it so, once I unlocked the oracle drivers
installations I repeat the whole process from step 3, and in the
second round all installs without asking more than the first
password to install.
And it is done!
Above, someone gave a hint:
At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
If you forgot/misclicked in step 6, go to macOS System Preferences | Security & Privacy | General. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
It took me a couple of hours but I did finally find what he was talking about - it's actually in the bottom of the Mac - click on the gear icon and you'll find it eventually.
You need to update your virtualbox sw. On new version, there is VBoxDarwinAdditions.pkg included in a additions iso image, in older versions is missing.
you can do it from the windows 10 terminal
step 1: open CMD in administrator mode
step 2 paste this open CMD cd "C:\Program Files\Oracle\Virtualbox"
step 3: paste this command in the open CMD, you must indicate the name you have in VirtualBox
VBoxManage setextradata "Virtual machine name" VBoxInternal2/EfiGraphicsResolution X
Example:
VBoxManage setextradata "Mac OS Sierra" VBoxInternal2/EfiGraphicsResolution 1280x720
Before you start, close VirtualBox!
After those manipulations start VB as Administrator!
Run CMD as Administrator
Use lines below one by one:
cd "C:\Program Files\Oracle\Virtualbox"
VBoxManage setextradata “macOS_Catalina” VBoxInternal2/EfiGraphicsResolution 1920x1080
Screen Resolutions: 1280x720, 1920x1080, 2048x1080, 2560x1440, 3840x2160, 1280x800, 1280x1024, 1440x900, 1600x900
Description:
macOS_Catalina - insert your VB machine name.
1920x1080 - put here your Screen Resolution.
Cheers!
Have you tried https://www.virtualbox.org/manual/ch04.html which has step-by-step instructions to help you?
Make your VM bi-directional for Clipboard and Drag & Drop
Share folders from your host to the guest VM too.

reboot VM (run on vbox) into specific (compiled) kernel from shell

Im running ubuntu 14.04 with vbox . In this machine I compiled and run kernel 3.14 which I choose from the grub menu when ubuntu load on vbox.
The host also run on ubuntu 14.04.
I wanted to ask - is there a way to load the guest ubuntu into specific kernel with a command on shell?
I can start running a vm on vbox trough command line with this command :
VBoxManage startvm ubuservloc --type headless
but its not quite exactly what I need.
I don't know of any way to directly communicate from the host to the guest's GRUB, but there are several indirect ways you could go:
mount the /boot filesystem from the host and drop a file there that is read by the guest's grub.cfg.
VBoxManage controlvm keyboardputscancode to type a hotkey which is assigned to the correct kernel in GRUB (shortly after starting the VM)
Configure GRUB to listen to a (virtual) serial port and select the kernel by writing to that file
In case a second reboot is acceptable (first boot into default kernel and then reboot into desired kernel) there are also several ways (you can use the grub-set-default command from guest to choose your desired kernel and issue a reboot). Some I can think of here:
VBoxManage guestcontrol run to call a shell script from host in the guest (after guest additions have been loaded)
VBoxManage guestproperty to set a property from host and VBoxControl guestproperty to read it from an init script and decide from there
Just SSH into the guest and reboot from there :D
Obviously, if you always want to boot that kernel, why not make it default? And in case always you want to alternately boot two different kernels, you can also set the default for next boot to another one direclty from grub.cfg.

Accessing USB drive form WinPE prompt

I am trying to install Windows 8 on virtual box using a bootable WinPE DVD. The image file (.wim) is on the USB stick.
But when I boot from DVD, I cannot find the USB drive.
I need to execute the command
d:\imagex.exe /apply e:\imageC_20150528.wim 1 c:\
where D - dvd drive and say E - usb drive
But I cannot locate the USB drive from the command prompt.
When I use winPE I use DiskPart to determine the drive letter of the USB drive.
-Diskpart
-list volume
This should display all available drives
If the USB drive was inserted before you booted the system into PE, then the USB drive should already be mounted and have a drive letter. If it doesn't then it is likely the drive isn't supported (you might want to change your boot-image/disk to include additional drivers/tools to get access to your usb controller and connected device).
If your USB drive was inserted after you booted the system into PE (and your hardware is supported in PE) then I usually can access the disk in the following manner (worked even in XP PE):
go to commandline and start diskpart (following commands are in diskpart):
issue command: rescan enter
This 'Locates new disks that might have been added to the computer.'
Depending on diskpart version (and/or it's automount setting) this can be enough to automatically mount the file system for a new basic volume when it adds the drive to the system and assigns a drive letter to the volume.
When it doesn't, follow the following 2 steps:
command: list disk enter
to see a list of disks and some info (to check the drive was found)
command: list volume enter
lists volumes on all disks (to find volume number of the USB drive)
command: select volume=# enter (where #= volume number)
to select the specified volume and shift the focus to it
command: assign enter
to assign the next free letter to the current focused volume
OR: assign letter=# enter (where #= driveletter of choice)
This method usually works for me on most hardware.
See also: Diskpart commandline options on MS Technet
Really - you should be using a fairly current version of winPE - 5.1 is what I'm using - which is the version that parallels windows 8.1. I'm switching over to winPE 10 (they changed the numbering to be consistent with Windows)
The reason I bring this us is because you're using imagex - and dism.exe has largely replaced imagex.exe in more current versions of winPE.
If you're just doing this at the command prompt in a generic winPE, you can use mountvol.exe (with no parameters) to discover the drive letters that are available. Everything shifts around drive-letter-wise when you're in winPE. So it might not be e: any more.
Also, dism and/or imagex would be on the x: drive - which is the virtual drive that the winPE creates when it boots.

VirtualBox: extend partition

I have virtualbox-4.1.0 with centos-5.6 installed in. Now I would like to extend the VM image, which I previously allocated for virtual machine installation, it was 8Gb, that's not enough now. Is there a way to extend the partition without loosing information?
Actually in centos I have one root fs with my home dir etc. so this partition eventually would need to be resized.
Thanks in advance for suggestions!
It can be done in 4 steps :
Clone your VMDK to VDI format with VBoxManage Tool.
Resize the disk to create free space with VBoxManage Tool.
Modify the filesystem to allocate free space for your drive with GParted.
Add created disk space to Linux FileSystem.
The detailed steps are below (tested with "Virtual Machine CentOS 6.4" and "VirtualBox 4.2.18");
Observe disk format of the virtualbox file, if it is not *.vdi, convert disk format from *.wmdk to *.vdi. Open windows terminal:
$ VBoxManage clonehd --format VDI "path_of_wmdk_file" "path_of_vdi_file"
Resize disk size of vdi file. Open windows terminal. For example to do disk size ~500 GB => 512000;
$ VBoxManage modifymedium "path_of_vdi_file" --resize 512000
Choose *.vdi file instead of *.wmdk file as disk
Virtual Machine -> Settings -> Storage -> Controller : SATA (Right Click on *.wmdk file) -> Remove Attachment -> Add HardDisk and choose newly created *.vdi file
Download "gparted-live-x.xx.x-x-ixxx.iso" file from http://gparted.sourceforge.net/download.php. Mount this iso file as CD.
Virtual Machine -> Settings -> Storage -> Controller IDE (Right Click) -> Add CD/DVD -> Select gparted-live-x.xx.x-x-ixxx.iso file
Run virtual machine, Virtual Machine will boot from this CD. Choose default values with pressing "Enter", "Enter" ... until Gpart ISO GUI starts. Select tool gpart program and start.
Extend disk size as below;
Right click on partitions and if "possible" click on "Disable Active Partion".
Extend Partition as much as possible from GUI (for this case 500GB).
Right click the partition which is disabled and select "Enable Active Partion".
Apply and wait until the operations finished.
Shut down virtual machine.
Unmount gparted-live-x.xx.x-x-ixxx.iso.
Virtual Machine -> Settings -> Storage-> Controller IDE (Right Click on gparted-live-x.xx.x-x-ixxx.iso) -> Remove Attachement
Start the virtual machine.
Open linux terminal and login as root. Run commands below;
lvm vgdisplay
=> Free PE / Size 122880 / 480.00 GiB
lvm lvdisplay /dev/VolGroup/lv_root
=> Current LE 3978
Calculate the sum of the values above. In this case : 122880 + 3978 = 126858 <- will be used in the next command
lvm lvresize -l 126858 /dev/VolGroup/lv_root
resize2fs /dev/VolGroup/lv_root
lsblk
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 500G 0 disk
+¦sda1 8:1 0 500M 0 part /boot
L¦sda2 8:2 0 499.5G 0 part
+¦VolGroup-lv_root (dm-0) 253:0 0 480G 0 lvm /
L¦VolGroup-lv_swap (dm-1) 253:1 0 4G 0 lvm [SWAP]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Check whether the filesystem extended or not with creating a huge file:
fallocate -l 480G /test_file
Remove the test file of course:
rm -rif /test_file
I'm using a CentOS7 virtualbox, and I finally enlarged my partition /dev/mapper/centos-root - gparted doesn't work for me because I do not have a desktop on CentOS7 virtualbox.
Power off your CentOS virtual machine
Go into the directory of your *.vdi image. If you don't know where it is, look at your Virtualbox Manager GUI virtualbox -> settings -> storage -> *.vdi -> location e.g. mine is located under ~/VirtualBox VMs/CentOS7/CentOS.vdi
Back up your image just in case anything goes wrong
$ cp CentOS7.vdi CentOS7.backup.vdi
Resize your virtual storage size, e.g. 200 GB
$ VBoxManage modifyhd CentOS7.vdi --resize 204800
Power on your CentOS virtual machine, issue
$ sudo fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 209715199 104344576 8e Linux LVM
Use fdisk utility to delete/create partitions
$ sudo fdisk /dev/sda
You are in the fdisk utility interactive mode, issue following commands: (mostly just follow the default recommendation)
d - delete a partition
2 - select a partition to delete (/dev/sda2 here)
n - create a new partition
p - make it a primary partition
2 - make it on the same partition number as we deleted
<return> - set the starting block (by default)
<return> - set end ending block (by default)
w - write the partition and leave the fdisk interactive mode
Reboot your CentOS machine
$ sudo reboot
Resize the physical volume and verify the new size
$ sudo pvresize /dev/sda2
$ sudo pvscan
Take a look at your logical mapping volume to see what volume you want to enlarge, in my case, /dev/mapper/centos-root
Resize the file system by adding -r option, it will take care of resizing for you
$lvextend -r -l +100%FREE /dev/mapper/centos-root
Resize the file system:
$resize2fs /dev/mapper/fedora-root
For CentOS 7: $xfs_growfs /dev/mapper/fedora-root
Last check:
$df -h.
Reference:https://blog.jyore.com/2013/06/virtualbox-increase-size-of-rhelfedoracentosscientificos-guest-file-system/#comment-2879
I found this nugget at the link following. I worked perfect for me and only took 5 seconds.
As of VirtualBox 4 they added support for expansion.
VBoxManage modifyhd filename.vdi --resize 46080
That will resize a virtual disk image to 45GB.
https://superuser.com/questions/172651/increasing-disk-space-on-virtualbox
It can be done with 3 steps :
cloning your VMDK to VDI format using VBoxManage
resize the disk to create free space using VBoxManage
modify the filesystem to allocate free space to your drive, using GParted
Don't forget the last part, otherwise, you will have unallocated free space and your disk will still appear as full.
I wrote a tutorial here to resize your VM Disk
At some point the VBoxManage utility changed the syntax a little bit. It's worth noting that this doesn't work on all vm types so beware if you have a *.vmdk. An example command to change your HD to 40GB is:
$ VBoxManage modifyhd MyVirtualImage --resize 40960
For reference I am on VirtualBox 4.2.1, Mac 10.8.2
From the VirtualBox FAQ:
You have to clone the data from the VDI you already have to a new, larger VDI and expand the partition(s). You can use tools like CloneZilla to clone the virtual hard drive to the bigger one and Gparted to increase the partition size. Another method is to use CloneVDI by mpack and clone the VDI with a larger size, then resize the partition(s) with Gparted.
Since 4.0.0, you can use VBoxManage modifyhd --resize to resize the max size of the VDI. You can only make it bigger. After that, use Gparted to increase the partition size inside the VDI.
Alternatively you could attach another VDI and mount your /home there.
Search for CloneVDI tool on the Oracle VirtualBox forums. It worked for me and is a much easier GUI based program for anyone nervous at the command line. Also allows conversion from fixed to dynamic mode which VBoxManage.exe doesn't support (yet).
https://forums.virtualbox.org/viewtopic.php?f=6&t=22422
I spent a long time googling and finally got it working for me. ( before I found this ) And I wanted a place to save my work
use vboxmanage to add space to the disk image
use gparted to resize so all space is used
use blivet-gui to create a new volume :
Below is commands I copied from terminal in fedora :
dnf install blivet-gui
blivet-gui
lvremove /dev/mapper/fedora00-00
lvextend -l +100%FREE /dev/mapper/fedora00-root