5 ms·
The author describes using HTTP and a stub page to copy a file from host to VM. I've found Netcat (nc) to be a better option -- it's widely available and easy t
by jmillikin 5y ago
The author describes using HTTP and a stub page to copy a file from host to VM. I've found Netcat (nc) to be a better option -- it's widely available and easy to use as a simple pipe. You can combine it with tar to copy directories.
[guest]$ nc -l -p 1234 > some_file
[host]$ cat some_file | nc $GUEST_IP 1234
If Netcat isn't installed, many older UNIXes have Perl available to DYI a simple TCP server.
In the limit, some shells (GNU Bash for sure, and I think also Korn shell?) support connecting to a remote TCP endpoint via the /dev/tcp/ special prefix. In this configuration you'd have the host listen and the guest initiate.
Another trick with QEMU is bundling files into a disk image and then mounting them (as a CD-ROM or SCSI). Somewhat more cumbersome, but works even for guests that don't have a working network.
- smackeyacky 5y agoUnfortunately Solaris 2.6 doesn't have netcat installed. I should probably have kept on trying to get NFS working but I got the nostalgia trip bad when I found hotjava and couldn't resist trying to do something useful with it, since it was useless the day it was released.
- tyingq 5y agoYou could get rsh on the host machine, it's probably available from the package manager. And already there on the guest os. Not the most secure thing, but works.
- smackeyacky 5y agoI did think about rsh and rcp but if NFS doesn't work, likely those bad boys are toast as well. Will fiddle and see what is easiest.
- yjftsjthsd-h 5y ago> In the limit, some shells (GNU Bash for sure, and I think also Korn shell?) support connecting to a remote TCP endpoint via the /dev/tcp/ special prefix. EDIT: I'm wrong; Solaris has a `/dev/tcp` but it doesn't do that (details below courtesy of the person who corrected me) Original (incorrect) comment: Forget the shell: I'm 90% sure Solaris implemented that exact feature directly in the operating system, so you should absolutely be able to do this without any additional software, assuming that it was implemented by this version.
- smackeyacky 5y agoWhat's the syntax to test it? I definitely have a /dev/tcp inside the Solaris VM, is there a way to point it to a particular port?
- jmillikin 5y agoSome light Googling[1][2] shows that Solaris's /dev/tcp is some sort of pseudo-device for configuring the system's network settings. For both the Bash and Korn shells, the syntax looks like this: $ cat < /dev/tcp/localhost/1234 with traffic being uni-directional. More complex (bi-directional) examples documented at <https://tldp.org/LDP/abs/html/devref1.html#DEVTCP https://tldp.org/LDP/abs/html/devref1.html#DEVTCP>. Tested on macOS: # in one terminal bash$ nc -l 1234 # in second terminal bash$ cat </dev/tcp/localhost/1234 # lines typed into the 'nc' terminal will be printed to # the other. [1] https://docs.oracle.com/cd/E19857-01/817-1836-10/perfplat.html https://docs.oracle.com/cd/E19857-01/817-1836-10/perfplat.ht... [2] https://www.ibm.com/docs/en/was-nd/8.5.5?topic=systems-tuning-solaris https://www.ibm.com/docs/en/was-nd/8.5.5?topic=systems-tunin...
- smackeyacky 5y agoThe modern incarnations (appending server and port numbers) to /dev/tcp in Solaris doesn't work. No matter. Very curious as to why ftp doesn't work, I think I have missed something on the Debian side of things to enable old school ftp clients. You can log in, but even setting the system to PASV does nothing. 500 Port Rejected is the error you get.
- imglorp 5y agoSolaris also had TFTP and RCP for quick and dirty transfers.
- smackeyacky 5y agoLeaving this comment here for posterity: tftp I had completely forgotten about - it works (I installed the tftpd-hpa package on Debian). This is much easier than trying to transfer stuff with HotJava. FTP is harder, the supplied ftp client for this version of Solaris doesn't support passive mode so you need to configure the network to your QEMU VM as...something. I think at this stage I would like to set up a bridge on my second ethernet card and run all the VM's out of that, which would likely fix everything to do with networking. Regardless, tftp is perfectly good for bootstrapping Solaris 2.6 into something gnuseable.